Skip to content

Commit baa66b0

Browse files
committed
Fixed fetch call.
Fetch requires the credentials function to be wrapped in the callbacks object (otherwise the promise succeeds even though it has failed silently).
1 parent e1adf87 commit baa66b0

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

examples/fetch.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,10 @@ var path = require("path");
44
nodegit.Repository.open(path.resolve(__dirname, "../.git"))
55
.then(function(repo) {
66
return repo.fetch("origin", {
7-
credentials: function(url, userName) {
8-
return nodegit.Cred.sshKeyFromAgent(userName);
7+
callbacks: {
8+
credentials: function(url, userName) {
9+
return nodegit.Cred.sshKeyFromAgent(userName);
10+
}
911
}
1012
});
1113
}).done(function() {

0 commit comments

Comments
 (0)