Skip to content

Commit 1a3610d

Browse files
committed
Merge pull request #975 from srajko/repository-cleanup
Add support for git_repository__cleanup
2 parents efbd8e1 + ec97dbc commit 1a3610d

File tree

2 files changed

+16
-3
lines changed

2 files changed

+16
-3
lines changed

generate/input/descriptor.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1769,10 +1769,10 @@
17691769
"ignore": true
17701770
},
17711771
"repository": {
1772+
"dependencies": [
1773+
"git2/sys/repository.h"
1774+
],
17721775
"functions": {
1773-
"git_repository__cleanup": {
1774-
"ignore": true
1775-
},
17761776
"git_repository_discover": {
17771777
"isAsync": true,
17781778
"return": {

test/tests/repository.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,19 @@ describe("Repository", function() {
6767
});
6868
});
6969

70+
it("can be cleaned", function() {
71+
this.repository.cleanup();
72+
73+
// try getting a commit after cleanup (to test that the repo is usable)
74+
return this.repository.getHeadCommit()
75+
.then(function(commit) {
76+
assert.equal(
77+
commit.toString(),
78+
"32789a79e71fbc9e04d3eff7425e1771eb595150"
79+
);
80+
});
81+
});
82+
7083
it("can read the index", function() {
7184
return this.repository.index()
7285
.then(function(index) {

0 commit comments

Comments
 (0)