Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Added git_remote_url and git_remote_load

  • Loading branch information...
commit d9bc851831560165142bbc663d3b1b5f9835e174 1 parent 1203708
Tim Branyen tbranyen authored
Showing with 34 additions and 0 deletions.
  1. +10 −0 generate/descriptor.json
  2. +24 −0 test/tests/remote.js
10 generate/descriptor.json
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 }]
}
}
},
24 test/tests/remote.js
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");
+ });
+ });
+});
Please sign in to comment.
Something went wrong with that request. Please try again.