#!/bin/sh

IFS='
'

echo "Checking tabs & copyrights ..."
for file in $(git diff --cached --name-only); do
	if [ ! -f $file ]; then
		continue
	fi
	if ! BuildTools/CheckTabs.py $file; then
		echo "ERROR: '$file' contains expanded tabs. Aborting commit."
		exit -1
	fi
	if ! BuildTools/Copyrighter.py check-copyright $file; then
		echo "ERROR: '$file' has a copyright error. Aborting commit."
		exit -1
	fi
done
