Created
January 25, 2017 03:37
-
-
Save adymitruk/c76b6b1ada597beec9525ad44a39adbc to your computer and use it in GitHub Desktop.
This file contains hidden or 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
#!/bin/bash | |
# | |
# An example hook script to make use of push options. | |
# The example simply echoes all push options that start with 'echoback=' | |
# and rejects all pushes when the "reject" push option is used. | |
# | |
# To enable this hook, rename this file to "pre-receive". | |
# check if back merges are happening from important branches | |
echo "checking for bad branch names" | |
while read oldrev newrev refname; do | |
if [[ $oldrev == $zero_commit && ! $refname =~ ^refs/heads/[a-w]+$ ]]; then | |
echo "Blocking creation of new branch $refname because it must only contain lower-case alphabetical characters." | |
exit 1 | |
fi | |
done | |
exit 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment