Files
Sourcetrail/setup/git/git_pre_push_hook.sh
T
Andreas Stallinger 23fbe6c384 script: move forced test to precommit hook
NOTE: run setup.sh script to update the hooks
* commit message after building and testing
* pushing tags does not run builds and tests
2016-04-14 11:46:53 +02:00

27 lines
477 B
Bash
Executable File

#!/bin/bash
current_branch=$(git symbolic-ref -q --short HEAD)
FAIL="\033[31mFail:\033[00m"
PASS="\033[32mPass:\033[00m"
INFO="\033[33mInfo:\033[00m"
#handle delete remote branches
while read local_ref lorem_sha remote_ref remote_sha
do
if [ "$local_ref" == "(delete)" ]
then
if [ "$remote_ref" == "refs/heads/master" ]
then
echo -e $FAIL seriously dont delete the master
exit 1
else
echo "delete remote branch $remote_ref"
exit 0
fi
fi
done
exit 0