Skip to content

Commit 8de1cd5

Browse files
committed
Merge pull request #205 from nodegit/git_remote_url
Added git_remote_url and git_remote_load
2 parents 1203708 + d9bc851 commit 8de1cd5

File tree

2 files changed

+34
-0
lines changed

2 files changed

+34
-0
lines changed

generate/descriptor.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -553,6 +553,16 @@
553553
"return": {
554554
"copy": "git_strarray_copy"
555555
}
556+
},
557+
558+
"git_remote_load": {
559+
"ignore": false,
560+
"isConstructorMethod": true
561+
},
562+
563+
"git_remote_url": {
564+
"ignore": false,
565+
"args": [{ "isSelf": true }]
556566
}
557567
}
558568
},

test/tests/remote.js

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
var assert = require("assert");
2+
var path = require("path");
3+
4+
describe("Repository", function() {
5+
var reposPath = path.resolve("test/repos/workdir/.git");
6+
7+
var Repository = require("../../lib/repository");
8+
var Remote = require("../../lib/remote");
9+
10+
before(function() {
11+
var test = this;
12+
13+
return Repository.open(reposPath).then(function(repository) {
14+
test.repository = repository;
15+
});
16+
});
17+
18+
it("can read git remote url", function() {
19+
return Remote.load(this.repository, "origin").then(function(remote) {
20+
assert.ok(remote instanceof Remote);
21+
assert.equal(remote.url(), "https://github.com/nodegit/nodegit");
22+
});
23+
});
24+
});

0 commit comments

Comments
 (0)