git svn: the branch command no longer needs the full path
This was introduced in 0b2af457a4
("Fix branch detection when repository root is inaccessible")
but reintroduced in the previous commit.
Signed-off-by: Eric Wong <normalperson@yhbt.net>
This commit is contained in:
19
git-svn.perl
19
git-svn.perl
@ -666,9 +666,22 @@ sub cmd_branch {
|
||||
}
|
||||
}
|
||||
unless (defined $glob) {
|
||||
die "Unknown ",
|
||||
$_tag ? "tag" : "branch",
|
||||
" destination $_branch_dest\n";
|
||||
my $dest_re = qr/\b\Q$_branch_dest\E\b/;
|
||||
foreach my $g (@{$allglobs}) {
|
||||
$g->{path}->{left} =~ /$dest_re/ or next;
|
||||
if (defined $glob) {
|
||||
die "Ambiguous destination: ",
|
||||
$_branch_dest, "\nmatches both '",
|
||||
$glob->{path}->{left}, "' and '",
|
||||
$g->{path}->{left}, "'\n";
|
||||
}
|
||||
$glob = $g;
|
||||
}
|
||||
unless (defined $glob) {
|
||||
die "Unknown ",
|
||||
$_tag ? "tag" : "branch",
|
||||
" destination $_branch_dest\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
my ($lft, $rgt) = @{ $glob->{path} }{qw/left right/};
|
||||
|
Reference in New Issue
Block a user