Skip to content

Commit

Permalink
Expose git_remote_rename
Browse files Browse the repository at this point in the history
  • Loading branch information
implausible committed Mar 20, 2020
1 parent 1018e32 commit dd6aa63
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 1 deletion.
15 changes: 14 additions & 1 deletion generate/input/descriptor.json
Expand Up @@ -3312,7 +3312,20 @@
"ignore": true
},
"git_remote_rename": {
"ignore": true
"isAsync": true,
"args": {
"problems": {
"isReturn": true,
"shouldAlloc": true,
"cppClassName": "Array",
"jsClassName": "Array",
"size": "count",
"key": "strings"
}
},
"return": {
"isErrorCode": true
}
},
"git_remote_push": {
"isAsync": true,
Expand Down
25 changes: 25 additions & 0 deletions test/tests/remote.js
Expand Up @@ -101,6 +101,31 @@ describe("Remote", function() {
});
});

it("can rename a remote", function() {
var repository = this.repository;

return Remote.list(repository)
.then(function(remoteNames) {
assert.deepEqual(remoteNames, ["origin"]);
return Remote.rename(repository, "origin", "origin2");
})
.then(function(problems) {
assert.deepEqual(problems, []);
return Remote.list(repository);
})
.then(function(remoteNames) {
assert.deepEqual(remoteNames, ["origin2"]);
return Remote.rename(repository, "origin2", "origin");
})
.then(function(problems) {
assert.deepEqual(problems, []);
return Remote.list(repository);
})
.then(function(remoteNames) {
assert.deepEqual(remoteNames, ["origin"]);
});
});

it("can delete a remote", function() {
var repository = this.repository;

Expand Down

0 comments on commit dd6aa63

Please sign in to comment.