Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 42548ef

Browse files
committedMay 4, 2016
Merge pull request nodegit#1022 from nodegit/async-create-commit
Make `Commit.create` async
2 parents 83e55e2 + a734b9f commit 42548ef

File tree

2 files changed

+17
-9
lines changed

2 files changed

+17
-9
lines changed
 

‎generate/input/descriptor.json

+7-3
Original file line numberDiff line numberDiff line change
@@ -416,17 +416,21 @@
416416
"update_ref": {
417417
"isOptional": true
418418
}
419+
},
420+
"isAsync": true,
421+
"return": {
422+
"isErrorCode": true
419423
}
420424
},
421-
"git_commit_create_buffer": {
422-
"ignore": true
423-
},
424425
"git_commit_create_from_callback": {
425426
"ignore": true
426427
},
427428
"git_commit_create_from_ids": {
428429
"ignore": true
429430
},
431+
"git_commit_create_from_v": {
432+
"ignore": true
433+
},
430434
"git_commit_extract_signature": {
431435
"ignore": true
432436
},

‎test/tests/stage.js

+10-6
Original file line numberDiff line numberDiff line change
@@ -304,15 +304,19 @@ describe("Stage", function() {
304304
return index.writeTree();
305305
})
306306
.then(function (oid) {
307-
var signature = NodeGit.Signature.create("Foo bar",
308-
"foo@bar.com", 123456789, 60);
309-
return test.repository.createCommit("HEAD", signature, signature,
310-
"initial commit", oid, []);
307+
return test.repository.getHeadCommit()
308+
.then(function(parent) {
309+
var signature = NodeGit.Signature.create("Foo bar",
310+
"foo@bar.com", 123456789, 60);
311+
return test.repository.createCommit("HEAD", signature, signature,
312+
"initial commit", oid, [parent]);
313+
});
311314
//... alright, we did a commit.
312315
})
313-
//Now if we compare head commit to index, should be a filemode change
316+
// Now if we compare head commit to the workdir,
317+
// there shouldn't be a filemode change
314318
.then(function() {
315-
return compareFilemodes(false, index, 0111 /* expect +x */);
319+
return compareFilemodes(true, null, 0);
316320
});
317321
});
318322

0 commit comments

Comments
 (0)
Please sign in to comment.