From 55ced83d8aca98277c6a495932c57e6c3c45930b Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Thu, 30 Aug 2007 19:17:42 -0700 Subject: [PATCH] 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 --- git-filter-branch.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 -- 2.26.2