aboutsummaryrefslogtreecommitdiff
path: root/git-svn.perl
diff options
context:
space:
mode:
authorEric Wong <normalperson@yhbt.net>2008-08-05 00:35:16 -0700
committerJunio C Hamano <gitster@pobox.com>2008-08-05 21:21:19 -0700
commitbd2d4f96b34ae295413f35eab687d7eff26564ee (patch)
treecb0517905c2e4cc4c1627a971c5a0bb1b1a26fb3 /git-svn.perl
parent1168d402d2962f56cbc921bbc954d8f2179c8ba7 (diff)
downloadgit-bd2d4f96b34ae295413f35eab687d7eff26564ee.tar.gz
git-bd2d4f96b34ae295413f35eab687d7eff26564ee.tar.xz
git-svn: properly set path for "info" command
canonicalize_path() was previously changed to better fit SVN 1.5, but it makes the "info" command not match svn(1) in two places: 1) URL ended up with a trailing slash when run without an argument. 2) "Path: " was displayed instead of "Path: ." when run without an argument. We will also handle odd cases where a user wants to get information on a file or directory named "0", too. Signed-off-by: Eric Wong <normalperson@yhbt.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'git-svn.perl')
-rwxr-xr-xgit-svn.perl8
1 files changed, 6 insertions, 2 deletions
diff --git a/git-svn.perl b/git-svn.perl
index cc35f5046..df0ed9027 100755
--- a/git-svn.perl
+++ b/git-svn.perl
@@ -796,8 +796,8 @@ sub cmd_commit_diff {
}
sub cmd_info {
- my $path = canonicalize_path(shift or ".");
- unless (scalar(@_) == 0) {
+ my $path = canonicalize_path(defined($_[0]) ? $_[0] : ".");
+ if (exists $_[1]) {
die "Too many arguments specified\n";
}
@@ -813,6 +813,10 @@ sub cmd_info {
die "Unable to determine upstream SVN information from ",
"working tree history\n";
}
+
+ # canonicalize_path() will return "" to make libsvn 1.5.x happy,
+ $path = "." if $path eq "";
+
my $full_url = $url . ($path eq "." ? "" : "/$path");
if ($_url) {