summaryrefslogtreecommitdiffstats
path: root/roles/git/hooks/files/update-block-push-origin
blob: 8b427a8c993680a7b41dacc3b781a305c17b008b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#!/bin/sh
#
# Block pushes to branches if their name starts with `origin/`
# https://fedorahosted.org/rel-eng/ticket/4071

refname="${1}"

echo "${refname}" | grep -qE '^refs/heads/origin/'

if [ $? == 0 ]; then
    echo "Can't push a branch named $refname"
    exit 1
fi

exit 0