mirror of
https://github.com/Lime3DS/Lime3DS.git
synced 2024-11-27 03:54:17 +01:00
24 lines
582 B
Plaintext
24 lines
582 B
Plaintext
|
#!/bin/sh
|
||
|
|
||
|
#check the config, in case the user really wants to allow tabs...
|
||
|
allowtabs=$(git config hooks.allowtabs)
|
||
|
if [ "$allowtabs" != "true" ] &&
|
||
|
git diff --cached | egrep '^\+.* '
|
||
|
then
|
||
|
cat<<END;
|
||
|
Error: This commit would contain a tab, which is against this repo's policy.
|
||
|
END
|
||
|
exit 1
|
||
|
fi
|
||
|
|
||
|
# If there are whitespace errors, print the offending file names and fail.
|
||
|
if
|
||
|
# Use git built-in checks for trailing whitespaces
|
||
|
! git diff --check --cached
|
||
|
then
|
||
|
cat<<END;
|
||
|
Error: This commit would contain trailing spaces, which is against this repo's policy.
|
||
|
END
|
||
|
exit 1
|
||
|
fi
|