From: Stephen Haberman Date: Mon, 25 Aug 2008 16:26:25 +0000 (-0500) Subject: We can't use =~ in cbas1's version of bash. X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=de43e767b432475a73f2b29bf29678914c285e9a;p=git-central.git We can't use =~ in cbas1's version of bash. --- diff --git a/server/update-ensure-tag-in-branch b/server/update-ensure-tag-in-branch index 268bfae..f45f3ef 100644 --- a/server/update-ensure-tag-in-branch +++ b/server/update-ensure-tag-in-branch @@ -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 diff --git a/server/update-stable b/server/update-stable index fb1a8e6..6e1264b 100644 --- a/server/update-stable +++ b/server/update-stable @@ -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)