summaryrefslogtreecommitdiff
path: root/builddeps/hooks/prepare-commit-msg
blob: df189bac1e59533ef4f3883d7b8fc3f2a46f9b8a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
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