diff options
| -rwxr-xr-x | hooks/pre-commit | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/hooks/pre-commit b/hooks/pre-commit index ec2b5b77e..04fdaf8ec 100755 --- a/hooks/pre-commit +++ b/hooks/pre-commit | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | #!/bin/bash | 1 | #!/bin/sh |
| 2 | 2 | ||
| 3 | # Enforce citra's whitespace policy | 3 | # Enforce citra's whitespace policy |
| 4 | git config --local core.whitespace tab-in-indent,trailing-space | 4 | git config --local core.whitespace tab-in-indent,trailing-space |
| @@ -32,7 +32,7 @@ for f in $(git diff --name-only --diff-filter=ACMRTUXB --cached); do | |||
| 32 | if ! echo "$f" | egrep -q "^src/"; then | 32 | if ! echo "$f" | egrep -q "^src/"; then |
| 33 | continue | 33 | continue |
| 34 | fi | 34 | fi |
| 35 | d=$(diff -u "$f" <(clang-format "$f")) | 35 | d=$(clang-format "$f" | diff -u "$f" -) |
| 36 | if ! [ -z "$d" ]; then | 36 | if ! [ -z "$d" ]; then |
| 37 | echo "!!! $f not compliant to coding style, here is the fix:" | 37 | echo "!!! $f not compliant to coding style, here is the fix:" |
| 38 | echo "$d" | 38 | echo "$d" |
| @@ -40,4 +40,4 @@ for f in $(git diff --name-only --diff-filter=ACMRTUXB --cached); do | |||
| 40 | fi | 40 | fi |
| 41 | done | 41 | done |
| 42 | 42 | ||
| 43 | exit "$fail" | 43 | exit "${fail-0}" |