diff --git a/generate/input/descriptor.json b/generate/input/descriptor.json index 13fc597c4..09f39fb3d 100644 --- a/generate/input/descriptor.json +++ b/generate/input/descriptor.json @@ -1602,7 +1602,18 @@ } }, "git_remote_default_branch": { - "ignore": true + "isAsync": true, + "args": { + "out": { + "isReturn": true + }, + "remote": { + "isSelf": true + } + }, + "return": { + "isErrorCode": true + } }, "git_remote_delete": { "isAsync": true, diff --git a/test/tests/remote.js b/test/tests/remote.js index 82bb91b33..747bf2eba 100644 --- a/test/tests/remote.js +++ b/test/tests/remote.js @@ -150,6 +150,22 @@ describe("Remote", function() { }); }); + it("can get the default branch of a remote", function() { + var remoteCallbacks = { + certificateCheck: function() { + return 1; + } + }; + + var remote = this.remote; + + return remote.connect(NodeGit.Enums.DIRECTION.FETCH, remoteCallbacks) + .then(function() { return remote.defaultBranch(); }) + .then(function(branchName) { + assert.equal("refs/heads/master", branchName); + }); + }); + it("can fetch from a remote", function() { return this.repository.fetch("origin", { callbacks: {