@matheusbsbs / matheus-bagliano / commits / f705059931
Fork 0

git-svn: convert globs to regexps for branch destinations

Marc Branchaud wrote: > I'm fairly happy with this, except for the way the branch > subcommand matches refspecs. The patch does a simple string > comparison, but it'd be better to do an actual glob. I just > couldn't track down the right function for that, so I left it as > a strcmp and hope that a gitizen can tell me how to glob here. Signed-off-by: Eric Wong <normalperson@yhbt.net>

Eric Wong committed Jun 25, 2009 at 02:28 UTC f7050599310c18bd67b35b8d59486116b30ff1f6
1 file changed +3 -1
git-svn.perl
+3 -1
@@ -646,7 +646,9 @@ sub cmd_branch {
646 " with the --destination argument.\n";
647 }
648 foreach my $g (@{$allglobs}) {
649 - if ($_branch_dest eq $g->{path}->{left}) {
649 + # SVN::Git::Editor could probably be moved to Git.pm..
650 + my $re = SVN::Git::Editor::glob2pat($g->{path}->{left});
651 + if ($_branch_dest =~ /$re/) {
652 $glob = $g;
653 last;
654 }