Skip to content

Commit

Permalink
fix(cli): Use only file names when determining if the staging area is…
Browse files Browse the repository at this point in the history
… 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.
  • Loading branch information
d4rkr00t committed Oct 22, 2015
1 parent 847901c commit a069f8f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/commitizen/staging.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@ export {isClean};
* Asynchrounously determines if the staging area is clean
*/
function isClean(repoPath, done) {
git.exec({cwd:repoPath, args: '--no-pager diff --cached', quiet: true}, function (err, stdout) {
git.exec({cwd:repoPath, args: '--no-pager diff --cached --name-only', quiet: true}, function (err, stdout) {
let stagingIsClean;
if(stdout && isString(stdout) && stdout.trim().length>0)
{
stagingIsClean = false;
stagingIsClean = false;
} else {
stagingIsClean = true;
}
done(stagingIsClean);
});
}
}

0 comments on commit a069f8f

Please sign in to comment.