Created
February 25, 2013 09:28
-
-
Save jbleuzen/5028717 to your computer and use it in GitHub Desktop.
Quick and dirty pre-commit for git
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
### pre-commit.sh | |
# Store git index status | |
git stash -q --keep-index | |
PWD=`pwd` | |
$PWD/bin/run_tests.sh | |
# Store tests result | |
RESULT=$? | |
# Restore previous index status | |
git stash pop -q | |
[ $RESULT -ne 0 ] && exit 1 | |
exit 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment