[sysadmin-bin] Make sure protected branches cannot be deleted



commit f8379c339f1aa68eb7dfefbc1cca67c6ee197e02
Author: Andrea Veri <averi redhat com>
Date:   Fri Jul 27 10:39:15 2018 +0200

    Make sure protected branches cannot be deleted

 git/pre-receive-check-policy | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/git/pre-receive-check-policy b/git/pre-receive-check-policy
index 6013c6a..b6d940e 100755
--- a/git/pre-receive-check-policy
+++ b/git/pre-receive-check-policy
@@ -139,10 +139,10 @@ check_ref_update() {
                    # people need to do it to clean up accidentally pushed
                    # branches. Deleting master, however, has no purpose other
                    # than getting around the no-fast-forward restrictions
-                   if [ "x$branchname" = xmaster ] ; then
+                   if [ "$is_protected" = true  ] ; then
                        cat <<- EOF >&2
                                ---
-                               You are trying to delete the branch 'master'.
+                               You are trying to delete a protected branch.
                                ---
                                EOF
                        exit 1


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]