Skip to content

Commit c1ef342

Browse files
authored
Merge pull request #1245 from rcjsuen/optional-discover
`ceiling_dirs` parameter in `Repository.discover` is optional
2 parents 22073e0 + 0f53a51 commit c1ef342

File tree

2 files changed

+15
-2
lines changed

2 files changed

+15
-2
lines changed

generate/input/descriptor.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3260,6 +3260,9 @@
32603260
"isErrorCode": true
32613261
},
32623262
"args": {
3263+
"ceiling_dirs": {
3264+
"isOptional": true
3265+
},
32633266
"out": {
32643267
"isReturn": true,
32653268
"isSelf": false,

test/tests/repository.js

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -208,13 +208,23 @@ describe("Repository", function() {
208208
});
209209
});
210210

211-
it("can discover if a path is part of a repository", function() {
211+
function discover(ceiling) {
212212
var testPath = path.join(reposPath, "lib", "util", "normalize_oid.js");
213213
var expectedPath = path.join(reposPath, ".git");
214-
return NodeGit.Repository.discover(testPath, 0, "")
214+
return NodeGit.Repository.discover(testPath, 0, ceiling)
215215
.then(function(foundPath) {
216216
assert.equal(expectedPath, foundPath);
217217
});
218+
}
219+
220+
it("can discover if a path is part of a repository, null ceiling",
221+
function() {
222+
return discover(null);
223+
});
224+
225+
it("can discover if a path is part of a repository, empty ceiling",
226+
function() {
227+
return discover("");
218228
});
219229

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

0 commit comments

Comments
 (0)