Skip to content

Commit 7c4703b

Browse files
thierrymicheljimthedev
authored andcommittedOct 3, 2018
fix(cli): Make gz -a working again (#573)
closes #543
1 parent b81dcb3 commit 7c4703b

File tree

2 files changed

+14
-3
lines changed

2 files changed

+14
-3
lines changed
 

‎src/commitizen/staging.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ export { isClean };
66
* Asynchrounously determines if the staging area is clean
77
*/
88
function isClean (repoPath, done) {
9-
exec('git diff --cached --name-only', {
9+
exec('git diff --no-ext-diff --name-only && git diff --no-ext-diff --cached --name-only', {
1010
maxBuffer: Infinity,
1111
cwd: repoPath || process.cwd()
1212
}, function (error, stdout) {

‎test/tests/staging.js

+13-2
Original file line numberDiff line numberDiff line change
@@ -63,9 +63,20 @@ describe('staging', function () {
6363
staging.isClean(repoConfig.path, function (afterWriteStagingIsCleanError, afterWriteStagingIsClean) {
6464
expect(afterWriteStagingIsCleanError).to.be.null;
6565
expect(afterWriteStagingIsClean).to.be.false;
66-
done();
67-
});
6866

67+
writeFilesToPath({
68+
dummymodified: {
69+
contents: repoConfig.files.dummyfile.contents + '-modified',
70+
filename: repoConfig.files.dummyfile.filename,
71+
}
72+
}, repoConfig.path);
73+
74+
staging.isClean(repoConfig.path, function (afterWriteStagingIsCleanError, afterWriteStagingIsClean) {
75+
expect(afterWriteStagingIsCleanError).to.be.null;
76+
expect(afterWriteStagingIsClean).to.be.false;
77+
done();
78+
});
79+
});
6980
});
7081
});
7182
});

0 commit comments

Comments
 (0)
Please sign in to comment.