Skip to content

Commit

Permalink
Fix Git change detection
Browse files Browse the repository at this point in the history
Fixes #18
  • Loading branch information
samuelmeuli committed Feb 12, 2020
1 parent b9484e3 commit bba22ac
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/git.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,9 @@ function getHeadSha() {
* @returns {boolean} - Boolean indicating whether changes exist
*/
function hasChanges() {
return run("git diff-index --quiet --cached HEAD --").status === 1;
const res = run("git diff-index --quiet HEAD --", { ignoreErrors: true }).status === 1;
log(`${res ? "Changes" : "No changes"} found with Git`);
return res;
}

/**
Expand Down

0 comments on commit bba22ac

Please sign in to comment.