From 7c21ef56996393eb015b2bbdf4151540cfbad980 Mon Sep 17 00:00:00 2001 From: John Haley Date: Tue, 3 May 2016 13:57:03 -0700 Subject: [PATCH 1/2] Make `Commit.create` async Creating a commit should be an async action, this makes it so. --- generate/input/descriptor.json | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/generate/input/descriptor.json b/generate/input/descriptor.json index 1b49c91cd..fbe9fd4fc 100644 --- a/generate/input/descriptor.json +++ b/generate/input/descriptor.json @@ -416,17 +416,21 @@ "update_ref": { "isOptional": true } + }, + "isAsync": true, + "return": { + "isErrorCode": true } }, - "git_commit_create_buffer": { - "ignore": true - }, "git_commit_create_from_callback": { "ignore": true }, "git_commit_create_from_ids": { "ignore": true }, + "git_commit_create_from_v": { + "ignore": true + }, "git_commit_extract_signature": { "ignore": true }, From a734b9fef9115592ed54d4443220c3b03cdfb520 Mon Sep 17 00:00:00 2001 From: John Haley Date: Tue, 3 May 2016 14:26:19 -0700 Subject: [PATCH 2/2] Fix filemode changes test That test was wrong, wrong, wrongity, wrong and now it's :100: --- test/tests/stage.js | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/test/tests/stage.js b/test/tests/stage.js index e49db7535..ac0675492 100644 --- a/test/tests/stage.js +++ b/test/tests/stage.js @@ -304,15 +304,19 @@ describe("Stage", function() { return index.writeTree(); }) .then(function (oid) { - var signature = NodeGit.Signature.create("Foo bar", - "foo@bar.com", 123456789, 60); - return test.repository.createCommit("HEAD", signature, signature, - "initial commit", oid, []); + return test.repository.getHeadCommit() + .then(function(parent) { + var signature = NodeGit.Signature.create("Foo bar", + "foo@bar.com", 123456789, 60); + return test.repository.createCommit("HEAD", signature, signature, + "initial commit", oid, [parent]); + }); //... alright, we did a commit. }) - //Now if we compare head commit to index, should be a filemode change + // Now if we compare head commit to the workdir, + // there shouldn't be a filemode change .then(function() { - return compareFilemodes(false, index, 0111 /* expect +x */); + return compareFilemodes(true, null, 0); }); });