Skip to content

Commit

Permalink
use git diff instead of diff-index to check for clean dir
Browse files Browse the repository at this point in the history
  • Loading branch information
jbrunton committed Jul 27, 2020
1 parent 6756a85 commit 0230f6f
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/plugin/git/Git.js
Expand Up @@ -89,7 +89,10 @@ class Git extends GitBase {
}

isWorkingDirClean() {
return this.exec('git diff-index --quiet HEAD --', { options }).then(
// Note: the update-index is required here for cases where files may be touched/recreated
// during a build/test hook. Git will mark those as potentially changed, but won't diff them
// until the index is updated. See also https://github.com/release-it/release-it/issues/687
return this.exec('git diff --quiet HEAD', { options }).then(
() => true,
() => false
);
Expand Down

0 comments on commit 0230f6f

Please sign in to comment.