diff options
Diffstat (limited to 'hooks')
-rwxr-xr-x | hooks/pre-commit | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/hooks/pre-commit b/hooks/pre-commit index 6dd281c4a..04fdaf8ec 100755 --- a/hooks/pre-commit +++ b/hooks/pre-commit @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/sh # Enforce citra's whitespace policy git config --local core.whitespace tab-in-indent,trailing-space @@ -10,7 +10,7 @@ if ! git diff --cached --check -- $paths_to_check ; then cat<<END Error: This commit would contain trailing spaces or tabs, which is against this repo's policy. -Please correct those issues before commiting. (Use 'git diff --check' for more details) +Please correct those issues before committing. (Use 'git diff --check' for more details) If you know what you are doing, you can try 'git commit --no-verify' to bypass the check END exit 1 @@ -32,7 +32,7 @@ for f in $(git diff --name-only --diff-filter=ACMRTUXB --cached); do if ! echo "$f" | egrep -q "^src/"; then continue fi - d=$(diff -u "$f" <(clang-format "$f")) + d=$(clang-format "$f" | diff -u "$f" -) if ! [ -z "$d" ]; then echo "!!! $f not compliant to coding style, here is the fix:" echo "$d" @@ -40,4 +40,4 @@ for f in $(git diff --name-only --diff-filter=ACMRTUXB --cached); do fi done -exit "$fail" +exit "${fail-0}" |