|
|
|
@ -1,7 +1,7 @@
@@ -1,7 +1,7 @@
|
|
|
|
|
#!/bin/sh |
|
|
|
|
# |
|
|
|
|
# An example hook script to verify what is about to be committed. |
|
|
|
|
# Called by "git commit" with no arguments. The hook should |
|
|
|
|
# Called by "git commit" with no arguments. The hook should |
|
|
|
|
# exit with non-zero status after issuing an appropriate message if |
|
|
|
|
# it wants to stop the commit. |
|
|
|
|
# |
|
|
|
@ -50,16 +50,16 @@ fi
@@ -50,16 +50,16 @@ fi
|
|
|
|
|
git diff-index --check --cached $against -- |
|
|
|
|
if [ $? -ne 0 ]; then |
|
|
|
|
echo "Pre-commit style error: Whitespace issues" |
|
|
|
|
exit 1 |
|
|
|
|
exit 1 |
|
|
|
|
fi |
|
|
|
|
|
|
|
|
|
# Check for code style, only in changed files |
|
|
|
|
for i in `git diff --cached --name-only --diff-filter=ACM` |
|
|
|
|
do |
|
|
|
|
./Tools/astyle/files_to_check_code_style.sh $i | xargs -n 1 -P 8 -I % ./Tools/astyle/check_code_style.sh % |
|
|
|
|
if [ $? -ne 0 ] |
|
|
|
|
then |
|
|
|
|
./Tools/astyle/files_to_check_code_style.sh $i | xargs -n 1 -P 8 -I % ./Tools/astyle/check_code_style.sh % |
|
|
|
|
if [ $? -ne 0 ] |
|
|
|
|
then |
|
|
|
|
echo "Pre-commit style error: Bad formatting according to astyle rules" |
|
|
|
|
exit 1 |
|
|
|
|
fi |
|
|
|
|
exit 1 |
|
|
|
|
fi |
|
|
|
|
done |
|
|
|
|