Files
Sourcetrail/.git_pre_commit_hook.sh
T
Andreas Stallinger 5ef9ef9e7d build: publish and sync script modification
now you can pass a branch to the publish and sync script to sync or publish to another branch  then master
2015-11-10 10:11:50 +01:00

28 lines
464 B
Bash
Executable File

#!/bin/bash
ABORT="\033[31mAbort:\033[00m"
SUCCESS="\033[32mSuccess:\033[00m"
INFO="\033[33mInfo:\033[00m"
BRANCH_NAME=$(git symbolic-ref -q --short HEAD)
if [ -z $BRANCH_NAME ]
then
echo -e $ABORT "You are not on any branch."
exit 1
fi
if [ $BRANCH_NAME == "master" ]
then
echo -e $ABORT "Commiting to master is prohibited."
exit 1
fi
if [ $BRANCH_NAME == "public_beta" ]
then
echo -e $ABORT "Commiting to public_beta is prohibited."
exit 1
fi
exit 0