Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Add Repo.openIndex #198

Merged
merged 2 commits into from

1 participant

@tbranyen
Owner

Closes #197

@tbranyen tbranyen Add Repo.openIndex
967b414
@tbranyen tbranyen referenced this pull request
Closed

Repo#openIndex missing #197

@tbranyen tbranyen Added a backing unit test
d5e1a03
@tbranyen tbranyen merged commit b21ff7c into from
@tbranyen tbranyen deleted the branch
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Jul 16, 2014
  1. @tbranyen

    Add Repo.openIndex

    tbranyen authored
  2. @tbranyen

    Added a backing unit test

    tbranyen authored
This page is out of date. Refresh to see the latest.
View
4 generate/descriptor.json
@@ -528,6 +528,10 @@
"ignore": false
},
+ "git_repository_index": {
+ "ignore": false
+ },
+
"git_repository_init": {
"isConstructorMethod": true,
"ignore": false
View
5 lib/repository.js
@@ -9,6 +9,11 @@ var Commit = require("./commit");
var TreeBuilder = NodeGit.Treebuilder;
var Repository = NodeGit.Repository;
+Object.defineProperty(Repository.prototype, "openIndex", {
+ enumerable: false,
+ value: Repository.prototype.index
+});
+
/**
* Look up a branch"s most recent commit.
*
View
7 test/tests/repository.js
@@ -6,6 +6,7 @@ describe("Repository", function() {
var newRepo = path.resolve("test/repos/newrepo");
var Repository = require("../../lib/repository");
+ var Index = require("../../lib/index");
before(function() {
var test = this;
@@ -38,4 +39,10 @@ describe("Repository", function() {
return Repository.open(newRepo);
});
});
+
+ it("can read the index", function() {
+ return this.repository.index().then(function(index) {
+ assert.ok(index instanceof Index);
+ });
+ });
});
Something went wrong with that request. Please try again.