Fix-up previous expr changes.
authorJunio C Hamano <junkio@cox.net>
Fri, 14 Apr 2006 02:05:38 +0000 (19:05 -0700)
committerJunio C Hamano <junkio@cox.net>
Fri, 14 Apr 2006 02:05:38 +0000 (19:05 -0700)
The regexp on the right hand side of expr : operator somehow was
broken.

expr 'z+pu:refs/tags/ko-pu' : 'z\+\(.*\)'

does not strip '+'; write 'z+\(.*\)' instead.

We probably should switch to shell based substring post 1.3.0;
that's not bashism but just POSIX anyway.

Signed-off-by: Junio C Hamano <junkio@cox.net>
git-fetch.sh
git-parse-remote.sh

index 711650f..83143f8 100755 (executable)
@@ -252,10 +252,10 @@ fetch_main () {
       else
          not_for_merge=
       fi
-      if expr "z$ref" : 'z\+' >/dev/null
+      if expr "z$ref" : 'z+' >/dev/null
       then
          single_force=t
-         ref=$(expr "z$ref" : 'z\+\(.*\)')
+         ref=$(expr "z$ref" : 'z+\(.*\)')
       else
          single_force=
       fi
index 65c66d5..c9b899e 100755 (executable)
@@ -77,7 +77,7 @@ canon_refs_list_for_fetch () {
                force=
                case "$ref" in
                +*)
-                       ref=$(expr "z$ref" : 'z\+\(.*\)')
+                       ref=$(expr "z$ref" : 'z+\(.*\)')
                        force=+
                        ;;
                esac