summaryrefslogtreecommitdiffstats
path: root/roles/git/hooks/files/update-block-push-origin
diff options
context:
space:
mode:
Diffstat (limited to 'roles/git/hooks/files/update-block-push-origin')
-rw-r--r--roles/git/hooks/files/update-block-push-origin10
1 files changed, 10 insertions, 0 deletions
diff --git a/roles/git/hooks/files/update-block-push-origin b/roles/git/hooks/files/update-block-push-origin
new file mode 100644
index 000000000..17380e313
--- /dev/null
+++ b/roles/git/hooks/files/update-block-push-origin
@@ -0,0 +1,10 @@
+#!/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