diff options
Diffstat (limited to 'tools')
-rwxr-xr-x | tools/pre-commit | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/tools/pre-commit b/tools/pre-commit index 7cceb69a99..f9b41168d6 100755 --- a/tools/pre-commit +++ b/tools/pre-commit @@ -8,9 +8,6 @@ # http://mark-story.com/posts/view/using-git-commit-hooks-to-prevent-stupid-mistakes # -# If there are whitespace errors, print the offending file names and fail. (from git pre-commit.sample) -exec git diff-index --check --cached HEAD - # Check for newer versions of the pre-commit script if [ ./.git/hooks/pre-commit -ot ./tools/pre-commit ] ; then echo "Pre-commit hook script is outdated, please update!" @@ -33,6 +30,10 @@ for FILE in `git diff-index --cached --name-only HEAD | grep "\.[ch]$"` ; do ./tools/fix-encoding-args.pl $FILE done + +# If there are whitespace errors, print the offending file names and fail. (from git pre-commit.sample) +exec git diff-index --check --cached HEAD + exit # |