summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xsrc/tests/whitespace_test7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/tests/whitespace_test b/src/tests/whitespace_test
index ea2aecf60..e972b3083 100755
--- a/src/tests/whitespace_test
+++ b/src/tests/whitespace_test
@@ -14,7 +14,12 @@ if [ ! -d "$GIT_DIR" ]; then
exit 77
fi
-git grep -n -I '\s\+$' -- "$(git rev-parse --show-toplevel)" |
+{
+ # Look for lines with trailing whitespace in all files tracked by Git
+ git grep -n -I '\s\+$' -- "$(git rev-parse --show-toplevel)" ||
+ # Don't fail if no such lines were found anywhere
+ [[ $? == 1 ]]
+} |
awk -- "
BEGIN {
found = 0