FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Enable transfer progress by tbranyen · Pull Request #325 · nodegit/nodegit · GitHub

Repository navigation

3 changes: 0 additions & 3 deletions generate/input/descriptor.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -1348,9 +1348,6 @@
"sideband_progress": {
"ignore": true
},
"transfer_progress": {
"ignore": true
},
"update_tips": {
"ignore": true
}
Expand Down
1 change: 1 addition & 0 deletions generate/templates/partials/field_accessors.cc
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@
baton->{{ arg.name }} = {{ arg.name }};
{% endeach %}

baton->result = 0;
baton->req.data = baton;
baton->done = false;

Expand Down
36 changes: 36 additions & 0 deletions test/tests/remote.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,13 @@ describe("Remote", function() {

var reposPath = local("../repos/workdir/.git");
var url = "https://github.com/nodegit/test";
var url2 = "https://github.com/nodegit/test2";

function removeOrigins(repository) {
Remote.delete(repository, "origin1");
Remote.delete(repository, "origin2");
Remote.delete(repository, "origin3");
Remote.delete(repository, "test2");
}

before(function() {
Expand Down Expand Up @@ -110,6 +112,40 @@ describe("Remote", function() {
});
});

it("can monitor transfer progress while downloading", function() {
// Set a reasonable timeout here now that our repository has grown.
this.timeout(600000);

var repo = this.repository;
var wasCalled = false;

return Remote.create(repo, "test2", url2)
.then(function() {
return repo.getRemote("test2");
})
.then(function(remote) {
remote.setCallbacks({
credentials: function(url, userName) {
return NodeGit.Cred.sshKeyFromAgent(userName);
},
certificateCheck: function() {
return 1;
},

transferProgress: function() {
wasCalled = true;
}
});

return remote.fetch(null, repo.defaultSignature(), null);
})
.then(function() {
assert.ok(wasCalled);

Remote.delete(repo, "test2");
});
});

it("can fetch from a remote", function() {
return this.repository.fetch("origin", {
credentials: function(url, userName) {
Expand Down

Back | FazBrowse Home | New Git URL