diff options
-rwxr-xr-x | builddeps/hooks/prepare-commit-msg | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/builddeps/hooks/prepare-commit-msg b/builddeps/hooks/prepare-commit-msg new file mode 100755 index 0000000..df189ba --- /dev/null +++ b/builddeps/hooks/prepare-commit-msg @@ -0,0 +1,15 @@ +#!/bin/bash + +# Do we have whitespace errors? +files=$(git diff --cached --name-only) + +for file in $files +do + perl tools/checknl.pl $file 1>/dev/null + if [[ $? -ne 0 ]] + then + echo "** Failed to commit" + echo "** Whitespace error in $file" + exit 1 + fi +done |