Change-Id: If8f5f48dfd96c3657036f7b59b6ca905c9d24043
Reviewed-on: https://code.wireshark.org/review/531
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Tested-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
# From
# http://mark-story.com/posts/view/using-git-commit-hooks-to-prevent-stupid-mistakes
#
-for FILE in `git diff-index --cached --name-only HEAD | grep "\.[ch]$"` ; do
+
+# If there are whitespace errors, print the offending file names and fail. (from git pre-commit.sample)
+exec git diff-index --check --cached HEAD
+
+for FILE in `git diff-index --cached --name-only HEAD` ; do
#Exit immediately if a command exits with a non-zero status.
set -e
#Check if fix-encoding-args is good
./tools/fix-encoding-args.pl $FILE
- #Add whitetrailing spaces...
- #perl -p -i -e 's/\ +$//' $(find . -name "*.[ch]" -print)
done
exit