Skip to content

Commit a734b9f

Browse files
author
John Haley
committed
Fix filemode changes test
That test was wrong, wrong, wrongity, wrong and now it's 💯
1 parent 7c21ef5 commit a734b9f

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

test/tests/stage.js

Lines changed: 10 additions & 6 deletions
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-
"[email protected]", 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+
"[email protected]", 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)