git-svn: fix regex to remove "tail" from svn tags
authorDavid D. Kilzer <ddkilzer@kilzer.net>
Sun, 15 Aug 2010 13:15:54 +0000 (06:15 -0700)
committerEric Wong <normalperson@yhbt.net>
Sun, 15 Aug 2010 23:43:35 +0000 (23:43 +0000)
Fix a regular expression used to remove the revision from the
end of an svn tag or branch name. The regex did not account for
any "tail" (dashes) that may have been added to the end of the
tag name (which first appeared in v1.4.1-rc2~11). If not fixed,
tags with names like "tags/mytag@5--@2" may be created.

Signed-off-by: David D. Kilzer <ddkilzer@kilzer.net>
Acked-by: Eric Wong <normalperson@yhbt.net>
git-svn.perl
index 34884b8fce37008ca05369dbd365573c7112ca21..39bcb45593e91bad14adb4b59a4d82b6821635cd 100755 (executable)
@@ -2959,7 +2959,7 @@ sub other_gs {
        my $gs = Git::SVN->find_by_url($new_url, $url, $branch_from);
        unless ($gs) {
                my $ref_id = $old_ref_id;
-               $ref_id =~ s/\@\d+$//;
+               $ref_id =~ s/\@\d+-*$//;
                $ref_id .= "\@$r";
                # just grow a tail if we're not unique enough :x
                $ref_id .= '-' while find_ref($ref_id);