]> git.droids-corp.org - git-central.git/commitdiff
We can't use =~ in cbas1's version of bash.
authorStephen Haberman <shaberman@payflex.com>
Mon, 25 Aug 2008 16:26:25 +0000 (11:26 -0500)
committerStephen Haberman <shaberman@payflex.com>
Mon, 25 Aug 2008 16:26:25 +0000 (11:26 -0500)
server/update-ensure-tag-in-branch
server/update-stable

index 268bfae3f5eee908f1f59072c15897798092c80c..f45f3ef637a838759d9a474280bf6abe58a3c359 100644 (file)
@@ -8,11 +8,14 @@ oldrev="$2"
 newrev="$3"
 
 # Only interested in tags
-if [[ "$refname" =~ refs/tags/(.*) ]] ; then
-       short_refname=${BASH_REMATCH[1]}
-else
-       exit 0
-fi
+case "$refname" in
+    refs/tags/*)
+        short_refname=${BASH_REMATCH[1]}
+        ;;
+    *)
+        exit 0
+        ;;
+esac
 
 # Except if they're getting deleted
 if [ "$newrev" == "0000000000000000000000000000000000000000" ] ; then
index fb1a8e62bcc73b46b394a0b13fbf331d2cfb6a81..6e1264b0aa7841662539a3efe31f91fe1ede6f25 100644 (file)
@@ -51,11 +51,14 @@ newrev="$3"
 . $(dirname $0)/functions
 set_change_type
 
-if [[ "$refname" =~ refs/heads/(.*) ]] ; then
-       short_refname=${refname##refs/heads/}
-else
-       exit 0
-fi
+case "$refname" in
+       refs/heads/*)
+               short_refname=${refname##refs/heads/}
+               ;;
+       *)
+               exit 0
+               ;;
+esac
 
 # create/delete is okay
 if [ "$change_type" != "update" ] ; then
@@ -122,9 +125,13 @@ else
        fi
 
        # For now candidates can mix amongst each other so early exit
-       if [[ "$refname" =~ refs/heads/candidate(.*) ]] ; then
-               exit 0
-       fi
+       case "$refname" in
+               refs/heads/candidate*)
+                       exit 0
+                       ;;
+               *)
+                       ;;
+       esac
 
        # Check if topic is already in candidates
        candidate=$(git branch --contains "$oldrev" | grep -oP candidate.* --max-count=1)