[sysadmin-bin] Make sure /Infrastructure gets the same treatment as /GNOME



commit 0ae0af031cb4d090a79d96999d51050bfd9fc655
Author: Andrea Veri <averi redhat com>
Date:   Thu Mar 15 12:58:53 2018 +0100

    Make sure /Infrastructure gets the same treatment as /GNOME

 git/gnome-pre-receive | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
---
diff --git a/git/gnome-pre-receive b/git/gnome-pre-receive
index a069aed..afa47ee 100755
--- a/git/gnome-pre-receive
+++ b/git/gnome-pre-receive
@@ -7,6 +7,7 @@
 # success or failure of the update.
 
 BINDIR=/home/admin/bin/git
+GITLABDIR=/var/opt/gitlab/git-data/repositories
 
 # If the committing user has a homedir with a .gitconfig in it, it we
 # don't want that to affect our operation. (Should this just be handled
@@ -64,7 +65,7 @@ EOF
 fi
 
 if [ $(hostname) == 'gitlab.gnome.org' ]; then
-  if [ $basedir = '/var/opt/gitlab/git-data/repositories/GNOME' ]; then
+  if [[ $basedir = "${GITLABDIR}/GNOME" || $basedir = "${GITLABDIR}/Infrastructure" ]]; then
     git config hooks.emailprefix 1>/dev/null
     if [ "$?" -eq 1 ]; then
       git config hooks.emailprefix ""
@@ -122,7 +123,7 @@ while read oldrev newrev refname; do
     # to bypass if l10.gnome.org were compromised.
     [ $my_uid != $translations_uid ] || $BINDIR/pre-receive-check-translations $oldrev $newrev $refname || 
exit 1
 
-    if [[ $basedir = '/var/opt/gitlab/git-data/repositories/GNOME' || $basedir = '/git' || $basedir = 
'/var/opt/gitlab/git-data/repositories/Infrastructure' ]]; then
+    if [[ $basedir = "${GITLABDIR}/GNOME" || $basedir = "${GITLABDIR}/Infrastructure" || $basedir = '/git' 
]]; then
         if [[ ! "${projectshort}.git" =~ .wiki.git$ ]]; then
             $BINDIR/pre-receive-check-policy $oldrev $newrev $refname || exit 1
             $BINDIR/pre-receive-check-maintainers $oldrev $newrev $refname || exit 1


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