Skip to content

Commit fc434a9

Browse files
committed
Merge pull request nodegit#326 from nodegit/remote-download-async
Make remote#download async
2 parents 684bec3 + 3e1daae commit fc434a9

2 files changed

Lines changed: 16 additions & 8 deletions

File tree

generate/input/descriptor.json

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1115,6 +1115,17 @@
11151115
"remote": {
11161116
"cType": "git_remote",
11171117
"functions": {
1118+
"git_remote_connect": {
1119+
"return": {
1120+
"isErrorCode": true
1121+
}
1122+
},
1123+
"git_remote_download": {
1124+
"isAsync": true,
1125+
"return": {
1126+
"isErrorCode": true
1127+
}
1128+
},
11181129
"git_remote_default_branch": {
11191130
"ignore": true
11201131
},

test/tests/remote.js

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -91,15 +91,12 @@ describe("Remote", function() {
9191
it("can download from a remote", function() {
9292
var repo = this.repository;
9393

94-
return Remote.load(repo, "origin")
95-
.then(function(remote) {
94+
return repo.getRemote("origin").then(function(remote) {
95+
remote.checkCert(0);
96+
9697
remote.connect(NodeGit.Enums.DIRECTION.FETCH);
98+
9799
return remote.download();
98-
})
99-
.then(function() {
100-
assert(true);
101-
}, function() {
102-
assert(false);
103100
});
104101
});
105102

@@ -114,7 +111,7 @@ describe("Remote", function() {
114111
it("can fetch from all remotes", function() {
115112
// Set a reasonable timeout here for the fetchAll test
116113
this.timeout(15000);
117-
114+
118115
return this.repository.fetchAll({
119116
credentials: function(url, userName) {
120117
return NodeGit.Cred.sshKeyFromAgent(userName);

0 commit comments

Comments
 (0)