Skip to content

Instantly share code, notes, and snippets.

@jbleuzen
Created February 25, 2013 09:28
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jbleuzen/5028717 to your computer and use it in GitHub Desktop.
Save jbleuzen/5028717 to your computer and use it in GitHub Desktop.
Quick and dirty pre-commit for git
### 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