Skip to content

Commit 02edea7

Browse files
committed
Add support for git_submodule_status
1 parent 257cb4f commit 02edea7

2 files changed

Lines changed: 26 additions & 7 deletions

File tree

generate/input/descriptor.json

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2028,7 +2028,16 @@
20282028
}
20292029
},
20302030
"git_submodule_status": {
2031-
"ignore": true
2031+
"isAsync": true,
2032+
"args": {
2033+
"status": {
2034+
"isReturn": true,
2035+
"shouldAlloc": true
2036+
}
2037+
},
2038+
"return": {
2039+
"isErrorCode": true
2040+
}
20322041
},
20332042
"git_submodule_sync": {
20342043
"isAsync": true,

test/tests/submodule.js

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,18 +16,18 @@ describe("Submodule", function() {
1616
return RepoUtils.createRepository(repoPath)
1717
.then(function(repo) {
1818
test.repository = repo;
19+
return Repository.open(local("../repos/workdir"));
20+
})
21+
.then(function(repo) {
22+
test.workdirRepository = repo;
1923
});
2024
});
2125

2226
it("can walk over the submodules", function() {
23-
var repo;
27+
var repo = this.workdirRepository;
2428
var submoduleName = "vendor/libgit2";
2529

26-
return Repository.open(local("../repos/workdir"))
27-
.then(function(_repo) {
28-
repo = _repo;
29-
return repo.getSubmoduleNames();
30-
})
30+
return repo.getSubmoduleNames()
3131
.then(function(submodules) {
3232
assert.equal(submodules.length, 1);
3333

@@ -43,6 +43,16 @@ describe("Submodule", function() {
4343
});
4444
});
4545

46+
it("can get submodule status", function() {
47+
var repo = this.workdirRepository;
48+
var submoduleName = "vendor/libgit2";
49+
50+
return Submodule.status(repo, submoduleName, Submodule.IGNORE.NONE)
51+
.then(function(status) {
52+
assert.equal(Submodule.STATUS.IN_CONFIG, status);
53+
});
54+
});
55+
4656
it("can setup and finalize submodule add", function() {
4757
var repo = this.repository;
4858
var submodulePath = "hellogitworld";

0 commit comments

Comments
 (0)