diff --git a/src/commitizen/staging.js b/src/commitizen/staging.js index 2a4f340c..70fc15b5 100644 --- a/src/commitizen/staging.js +++ b/src/commitizen/staging.js @@ -6,7 +6,7 @@ export { isClean }; * Asynchrounously determines if the staging area is clean */ function isClean (repoPath, done) { - exec('git diff --cached --name-only', { + exec('git diff --no-ext-diff --name-only && git diff --no-ext-diff --cached --name-only', { maxBuffer: Infinity, cwd: repoPath || process.cwd() }, function (error, stdout) { diff --git a/test/tests/staging.js b/test/tests/staging.js index 596b63be..6bdef21b 100644 --- a/test/tests/staging.js +++ b/test/tests/staging.js @@ -63,9 +63,20 @@ describe('staging', function () { staging.isClean(repoConfig.path, function (afterWriteStagingIsCleanError, afterWriteStagingIsClean) { expect(afterWriteStagingIsCleanError).to.be.null; expect(afterWriteStagingIsClean).to.be.false; - done(); - }); + writeFilesToPath({ + dummymodified: { + contents: repoConfig.files.dummyfile.contents + '-modified', + filename: repoConfig.files.dummyfile.filename, + } + }, repoConfig.path); + + staging.isClean(repoConfig.path, function (afterWriteStagingIsCleanError, afterWriteStagingIsClean) { + expect(afterWriteStagingIsCleanError).to.be.null; + expect(afterWriteStagingIsClean).to.be.false; + done(); + }); + }); }); }); });