Skip to content

Commit

Permalink
git-svn: convert globs to regexps for branch destinations
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Eric Wong committed Jun 25, 2009
1 parent 6224406 commit f705059
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion git-svn.perl
Original file line number Diff line number Diff line change
Expand Up @@ -646,7 +646,9 @@ sub cmd_branch {
" with the --destination argument.\n";
}
foreach my $g (@{$allglobs}) {
if ($_branch_dest eq $g->{path}->{left}) {
# SVN::Git::Editor could probably be moved to Git.pm..
my $re = SVN::Git::Editor::glob2pat($g->{path}->{left});
if ($_branch_dest =~ /$re/) {
$glob = $g;
last;
}
Expand Down

0 comments on commit f705059

Please sign in to comment.