]> asedeno.scripts.mit.edu Git - git.git/commitdiff
filter-branch: make sure orig_namespace ends with a single slash.
authorJunio C Hamano <gitster@pobox.com>
Fri, 31 Aug 2007 02:17:42 +0000 (19:17 -0700)
committerJunio C Hamano <gitster@pobox.com>
Fri, 31 Aug 2007 02:17:42 +0000 (19:17 -0700)
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 <gitster@pobox.com>
git-filter-branch.sh

index ec2f75de56799bc404f62c76e24b2dfa3f82b6f7..c166c978ec2a6e1dc26d8fb117c12ae59ca5b7fd 100755 (executable)
@@ -140,7 +140,7 @@ do
                filter_subdir="$OPTARG"
                ;;
        --original)
-               orig_namespace="$OPTARG"
+               orig_namespace=$(expr "$OPTARG/" : '\(.*[^/]\)/*$')/
                ;;
        *)
                usage