Skip to content

Commit

Permalink
Merge pull request #205 from nodegit/git_remote_url
Browse files Browse the repository at this point in the history
Added git_remote_url and git_remote_load
  • Loading branch information
tbranyen committed Jul 19, 2014
2 parents 1203708 + d9bc851 commit 8de1cd5
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 0 deletions.
10 changes: 10 additions & 0 deletions generate/descriptor.json
Original file line number Diff line number Diff line change
Expand Up @@ -553,6 +553,16 @@
"return": {
"copy": "git_strarray_copy"
}
},

"git_remote_load": {
"ignore": false,
"isConstructorMethod": true
},

"git_remote_url": {
"ignore": false,
"args": [{ "isSelf": true }]
}
}
},
Expand Down
24 changes: 24 additions & 0 deletions test/tests/remote.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
var assert = require("assert");
var path = require("path");

describe("Repository", function() {
var reposPath = path.resolve("test/repos/workdir/.git");

var Repository = require("../../lib/repository");
var Remote = require("../../lib/remote");

before(function() {
var test = this;

return Repository.open(reposPath).then(function(repository) {
test.repository = repository;
});
});

it("can read git remote url", function() {
return Remote.load(this.repository, "origin").then(function(remote) {
assert.ok(remote instanceof Remote);
assert.equal(remote.url(), "https://github.com/nodegit/nodegit");
});
});
});

0 comments on commit 8de1cd5

Please sign in to comment.