diff options
author | Eric Wong <normalperson@yhbt.net> | 2009-07-25 01:36:06 -0700 |
---|---|---|
committer | Eric Wong <normalperson@yhbt.net> | 2009-07-25 04:09:43 -0700 |
commit | eaa14ff8c7dbe51dfdfe7e2d9ede839fc62dcf52 (patch) | |
tree | 8ccc9e3285676850366262a41620f08d6b339674 /git-svn.perl | |
parent | 6b48829dbbe06798eded1e7c5f70810940591f79 (diff) | |
download | git-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-x | git-svn.perl | 19 |
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/}; |