[sysadmin-bin] Make sure commits-list as the repository m-l only lands when basedir is GNOME



commit 4e333caf8ec5e4b008be6d46769e51bb36cf7df6
Author: Andrea Veri <averi redhat com>
Date:   Fri Jun 30 11:20:48 2017 +0200

    Make sure commits-list as the repository m-l only lands when basedir is GNOME

 git/gnome-pre-receive |   18 ++++++++++--------
 1 files changed, 10 insertions(+), 8 deletions(-)
---
diff --git a/git/gnome-pre-receive b/git/gnome-pre-receive
index c8e1487..b7b6092 100755
--- a/git/gnome-pre-receive
+++ b/git/gnome-pre-receive
@@ -64,14 +64,16 @@ EOF
 fi
 
 if [ $(hostname) == 'gitlab.gnome.org' ] || [ $(hostname) == 'gitlab-test.gnome.org' ]; then
-  cd $GIT_DIR
-  cat config | grep -q 'hooks.emailprefix'
-  if [ "$?" -eq 1 ]; then
-    git config hooks.emailprefix ""
-  fi
-  cat config | grep -q 'hooks.emailprefix'
-  if [ "$?" -eq 1 ]; then
-    git config hooks.mailinglist commits-list gnome org
+  if [ $basedir = '/var/opt/gitlab/git-data/repositories/GNOME' ]; then
+    cd $GIT_DIR
+    cat $GIT_CONFIG | grep -q 'hooks.emailprefix'
+    if [ "$?" -eq 1 ]; then
+      git config hooks.emailprefix ""
+    fi
+    cat $GIT_CONFIG | grep -q 'hooks.emailprefix'
+    if [ "$?" -eq 1 ]; then
+      git config hooks.mailinglist commits-list gnome org
+    fi
   fi
 fi
 


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