diff options
| author | Lex Neva <lexelby@users.noreply.github.com> | 2024-10-25 08:03:14 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-10-25 08:03:14 -0400 |
| commit | d5313b1f92378697ec08d6d1d2833b64492ce435 (patch) | |
| tree | bc9105606a7b5f244138f628a6f46b16aea080c6 | |
| parent | 4e6fd162cde77cfc7a50f22170290e580164c484 (diff) | |
make hook actually cancel the commit (#3235)
| -rwxr-xr-x | bin/git-pre-commit-hook | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/bin/git-pre-commit-hook b/bin/git-pre-commit-hook index 4d81c5a7..e5a2d201 100755 --- a/bin/git-pre-commit-hook +++ b/bin/git-pre-commit-hook @@ -19,6 +19,13 @@ check_errors() { cd $(dirname "$0")/../.. check_errors git stash --keep-index -check_errors git diff --cached | bin/style-check 2>&1 + +errors="$(git diff --cached | bin/style-check 2>&1)" +status=$? +if [ "$status" != "0" ]; then + echo "$errors" +fi + check_errors git stash pop +exit $status |
