From: Junio C Hamano Date: Fri, 31 Aug 2007 02:17:42 +0000 (-0700) Subject: filter-branch: make sure orig_namespace ends with a single slash. X-Git-Tag: v1.5.3~22 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=55ced83d8aca98277c6a495932c57e6c3c45930b;p=git.git filter-branch: make sure orig_namespace ends with a single slash. Later in a loop any existing ref whose path begins with it is removed. It would be a disaster if you allowed it to say refs/head for example. Signed-off-by: Junio C Hamano --- diff --git a/git-filter-branch.sh b/git-filter-branch.sh index ec2f75de5..c166c978e 100755 --- a/git-filter-branch.sh +++ b/git-filter-branch.sh @@ -140,7 +140,7 @@ do filter_subdir="$OPTARG" ;; --original) - orig_namespace="$OPTARG" + orig_namespace=$(expr "$OPTARG/" : '\(.*[^/]\)/*$')/ ;; *) usage