Created
June 11, 2014 09:02
-
-
Save tombentley/c0eb2768e1718eefd195 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# If you want to allow filename that differ only by case set this variable to true. | |
allowcasecollision=$(git config hooks.allowcasecollision) | |
if [ "$allowcasecollision" != "true" ] && | |
test "$(git diff --cached --name-only | | |
LC_ALL=C tr [A-Z] [a-z] | | |
sort | | |
uniq --repeated )" | |
then | |
echo "Error: Attempt to add a file name which differs only by case from " | |
echo "another tracked file" | |
echo | |
echo "This can cause problems if you want to work" | |
echo "with people on other platforms." | |
echo | |
echo "To be portable it is advisable to rename the file ..." | |
echo | |
echo "If you know what you are doing you can disable this" | |
echo "check using:" | |
echo | |
echo " git config hooks.allowcasecollision true" | |
echo | |
exit 1 | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You could print to stderr instead, like this: