aboutsummaryrefslogtreecommitdiff
path: root/git-svn.perl
diff options
context:
space:
mode:
authorEric Wong <normalperson@yhbt.net>2009-07-25 01:36:06 -0700
committerEric Wong <normalperson@yhbt.net>2009-07-25 04:09:43 -0700
commiteaa14ff8c7dbe51dfdfe7e2d9ede839fc62dcf52 (patch)
tree8ccc9e3285676850366262a41620f08d6b339674 /git-svn.perl
parent6b48829dbbe06798eded1e7c5f70810940591f79 (diff)
downloadgit-eaa14ff8c7dbe51dfdfe7e2d9ede839fc62dcf52.tar.gz
git-eaa14ff8c7dbe51dfdfe7e2d9ede839fc62dcf52.tar.xz
git svn: the branch command no longer needs the full path
This was introduced in 0b2af457a49e3b00d47d556d5301934d27909db8 ("Fix branch detection when repository root is inaccessible") but reintroduced in the previous commit. Signed-off-by: Eric Wong <normalperson@yhbt.net>
Diffstat (limited to 'git-svn.perl')
-rwxr-xr-xgit-svn.perl19
1 files changed, 16 insertions, 3 deletions
diff --git a/git-svn.perl b/git-svn.perl
index 10b77ad34..9808597a1 100755
--- a/git-svn.perl
+++ b/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/};