Skip to content

Instantly share code, notes, and snippets.

@Bouke
Created March 18, 2013 13:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Bouke/5187280 to your computer and use it in GitHub Desktop.
Save Bouke/5187280 to your computer and use it in GitHub Desktop.
run all tests on pre-push
remote="$1"
url="$2"
while read local_ref local_sha remote_ref remote_sha
do
if [ "$remote_ref" == "refs/heads/master" ]; then
# echo "Pushing to refs/heads/master, running test cases"
if [ "$local_ref" == "HEAD" ]; then
[virtualenv's]python manage.py test --failfast
exit $?
else
echo "Please push from head `git push origin HEAD:master`"
exit 1
fi
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment