Skip to content

Commit a069f8f

Browse files
committed
fix(cli): Use only file names when determining if the staging area is clean
When there is a huge diff we got an error related to reach of maximum stack size. As a way of fix this issue i suggest to use only names of staged files instead of whole diff.
1 parent 847901c commit a069f8f

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/commitizen/staging.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,14 @@ export {isClean};
77
* Asynchrounously determines if the staging area is clean
88
*/
99
function isClean(repoPath, done) {
10-
git.exec({cwd:repoPath, args: '--no-pager diff --cached', quiet: true}, function (err, stdout) {
10+
git.exec({cwd:repoPath, args: '--no-pager diff --cached --name-only', quiet: true}, function (err, stdout) {
1111
let stagingIsClean;
1212
if(stdout && isString(stdout) && stdout.trim().length>0)
1313
{
14-
stagingIsClean = false;
14+
stagingIsClean = false;
1515
} else {
1616
stagingIsClean = true;
1717
}
1818
done(stagingIsClean);
1919
});
20-
}
20+
}

0 commit comments

Comments
 (0)