Permalink
Browse files

Merge pull request #205 from nodegit/git_remote_url

Added git_remote_url and git_remote_load
  • Loading branch information...
tbranyen committed Jul 19, 2014
2 parents 1203708 + d9bc851 commit 8de1cd51034d98675ce845c7e5b9dc33d782cdcc
Showing with 34 additions and 0 deletions.
  1. +10 −0 generate/descriptor.json
  2. +24 −0 test/tests/remote.js
View
@@ -553,6 +553,16 @@
"return": {
"copy": "git_strarray_copy"
}
+ },
+
+ "git_remote_load": {
+ "ignore": false,
+ "isConstructorMethod": true
+ },
+
+ "git_remote_url": {
+ "ignore": false,
+ "args": [{ "isSelf": true }]
}
}
},
View
@@ -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.