8000 Add support for git_repository__cleanup by srajko · Pull Request #975 · nodegit/nodegit · GitHub
[go: up one dir, main page]

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
6 changes: 3 additions & 3 deletions generate/input/descriptor.json
Original file line number Diff line number Diff line change
Expand Up @@ -1769,10 +1769,10 @@
"ignore": true
},
"repository": {
"dependencies": [
"git2/sys/repository.h"
],
"functions": {
"git_repository__cleanup": {
"ignore": true
},
"git_repository_discover": {
"isAsync": true,
"return": {
Expand Down
13 changes: 13 additions & 0 deletions test/tests/repository.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,19 @@ describe("Repository", function() {
});
});

it("can be cleaned", function() {
this.repository.cleanup();

// try getting a commit after cleanup (to test that the repo is usable)
return this.repository.getHeadCommit()
.then(function(commit) {
assert.equal(
commit.toString(),
"32789a79e71fbc9e04d3eff7425e1771eb595150"
);
});
});

it("can read the index", function() {
return this.repository.index()
.then(function(index) {
Expand Down
0