summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'BuildTools/Git/Hooks/pre-commit')
-rwxr-xr-xBuildTools/Git/Hooks/pre-commit16
1 files changed, 14 insertions, 2 deletions
diff --git a/BuildTools/Git/Hooks/pre-commit b/BuildTools/Git/Hooks/pre-commit
index 28bebfc..987f127 100755
--- a/BuildTools/Git/Hooks/pre-commit
+++ b/BuildTools/Git/Hooks/pre-commit
@@ -6,3 +6,15 @@ IFS='
echo "Checking tabs & copyrights ..."
+for file in $(git diff --cached --diff-filter=A --name-only); do
+ if [ ! -f $file ]; then
+ continue
+ fi
+ if ! BuildTools/Copyrighter.py check-copyright $file; then
+ echo "ERROR: '$file' has a copyright error. Aborting commit."
+ exit -1
+ fi
+done
for file in $(git diff --cached --name-only); do
+ if [ ! -f $file ]; then
+ continue
+ fi
if ! BuildTools/CheckTabs.py $file; then
@@ -11,4 +23,4 @@ for file in $(git diff --cached --name-only); do
fi
- if ! BuildTools/Copyrighter.py check-copyright $file; then
- echo "ERROR: '$file' has a copyright error. Aborting commit."
+ if ! BuildTools/CheckHeaders.py $file; then
+ echo "ERROR: '$file' failed header sanity test. Aborting commit."
exit -1