Created
July 16, 2015 11:08
-
-
Save coogie/96d34d70c7f7a671d6da to your computer and use it in GitHub Desktop.
A pre-commit hook to catch filename conflicts because hurr durr Windows
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
#!/bin/bash | |
# Save current state | |
git stash -u -q --keep-index || exit 1 | |
# Get the list of clashing files in the whole repository | |
CLASHING=`find "$(git rev-parse --show-toplevel)" | sort | uniq -d -i` | |
# Restore previous state | |
git stash pop -q | |
if [[ $CLASHING ]]; then | |
echo "Found clashing files on case-insensitive file systems" | |
echo "$CLASHING" | |
exit 1 | |
fi | |
exit 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment