From a069f8f0be34f2b05b128ded9151e3ded9a0dc16 Mon Sep 17 00:00:00 2001 From: Stanislav Sysoev Date: Thu, 22 Oct 2015 14:27:23 +0300 Subject: [PATCH] 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. --- src/commitizen/staging.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/commitizen/staging.js b/src/commitizen/staging.js index caac1f05..58895089 100644 --- a/src/commitizen/staging.js +++ b/src/commitizen/staging.js @@ -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); }); -} \ No newline at end of file +}