dist: add tab test

This commit is contained in:
Martine Lenders 2015-03-31 05:11:15 +02:00
parent dbd4475bfe
commit 2ec5f27a57

View File

@ -27,8 +27,16 @@ if [ -z "${BRANCH}" ]; then
BRANCH=$(git rev-list HEAD | tail -n 1)
fi
git diff --check $(git merge-base ${BRANCH} HEAD)
if [ $? -gt 0 ]
git -c core.whitespace="tab-in-indent,tabwidth=4" \
diff --check $(git merge-base ${BRANCH} HEAD) -- *.[ch]
RESULT=$?
# Git regards any trailing white space except `\n` as an error so `\r` is
# checked here, too
git -c core.whitespace="trailing-space" \
diff --check $(git merge-base ${BRANCH} HEAD)
if [ $? -ne 0 ] || [ $RESULT -ne 0 ]
then
echo "ERROR: This change introduces new whitespace errors"
exit 1