We already use the update hook for gitolite. This introduces a new update hook, which merely chains the gitolite one, and a new one to block pushes to badly named branches. The new hook was written originally by Till Maas. https://fedorahosted.org/rel-eng/ticket/4071
10 lines
242 B
Bash
10 lines
242 B
Bash
#!/bin/sh
|
|
#
|
|
# Block pushes to branches if their name starts with `origin/`
|
|
# https://fedorahosted.org/rel-eng/ticket/4071
|
|
|
|
refname="${1}"
|
|
sha1_old="${2}"
|
|
sha1_new="${3}"
|
|
|
|
echo "${refname}" | grep -qE '^refs/heads/origin/' && exit 1 || exit 0
|