aboutsummaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorAlexis La Goutte <alexis.lagoutte@gmail.com>2014-03-06 18:00:43 +0100
committerAlexis La Goutte <alexis.lagoutte@gmail.com>2014-03-06 17:05:57 +0000
commit49394d3101ec286b335213a9845b6d4202955021 (patch)
tree016b8d0d3bde63c2c0e3d24642f2ae30f6dbacf1 /tools
parentdbff30b040a59111e593529477d80f0fc0c708a8 (diff)
Update Wireshark pre-commit tools (Add check for trailing whitespace based from git pre-commit.sample)
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>
Diffstat (limited to 'tools')
-rwxr-xr-xtools/pre-commit8
1 files changed, 5 insertions, 3 deletions
diff --git a/tools/pre-commit b/tools/pre-commit
index 2103d3482f..46fe838655 100755
--- a/tools/pre-commit
+++ b/tools/pre-commit
@@ -7,7 +7,11 @@
# 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
@@ -22,8 +26,6 @@ for FILE in `git diff-index --cached --name-only HEAD | grep "\.[ch]$"` ; do
#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