Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
ceiling_dirs parameter in Repository.discover is optional
libgit2's git_repository_discover function's ceiling_dirs parameter
can be null. Flag the parameter as such in the JSON file so that the
NodeGit wrapper API behaves the same way.

Signed-off-by: Remy Suen <remy.suen@gmail.com>
  • Loading branch information
rcjsuen committed Dec 20, 2017
commit 0f53a5199adc7ec0a326d56b7d625e6f5f12c884
3 changes: 3 additions & 0 deletions generate/input/descriptor.json
Original file line number Diff line number Diff line change
Expand Up @@ -2245,6 +2245,9 @@
"isErrorCode": true
},
"args": {
"ceiling_dirs": {
"isOptional": true
},
"out": {
"isReturn": true,
"isSelf": false,
Expand Down
14 changes: 12 additions & 2 deletions test/tests/repository.js
Original file line number Diff line number Diff line change
Expand Up @@ -200,13 +200,23 @@ describe("Repository", function() {
});
});

it("can discover if a path is part of a repository", function() {
function discover(ceiling) {
var testPath = path.join(reposPath, "lib", "util", "normalize_oid.js");
var expectedPath = path.join(reposPath, ".git");
return NodeGit.Repository.discover(testPath, 0, "")
return NodeGit.Repository.discover(testPath, 0, ceiling)
.then(function(foundPath) {
assert.equal(expectedPath, foundPath);
});
}

it("can discover if a path is part of a repository, null ceiling",
function() {
return discover(null);
});

it("can discover if a path is part of a repository, empty ceiling",
function() {
return discover("");
});

it("can create a repo using initExt", function() {
Expand Down