@matheusbsbs / matheus-bagliano / commits / bd2d4f96b3
Fork 0

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>

Eric Wong committed Aug 5, 2008 at 00:35 UTC bd2d4f96b34ae295413f35eab687d7eff26564ee
1 file changed +6 -2
git-svn.perl
+6 -2
@@ -796,8 +796,8 @@ sub cmd_commit_diff {
796 }
797
798 sub cmd_info {
799 - my $path = canonicalize_path(shift or ".");
800 - unless (scalar(@_) == 0) {
799 + my $path = canonicalize_path(defined($_[0]) ? $_[0] : ".");
800 + if (exists $_[1]) {
801 die "Too many arguments specified\n";
802 }
803
@@ -813,6 +813,10 @@ sub cmd_info {
813 die "Unable to determine upstream SVN information from ",
814 "working tree history\n";
815 }
816 +
817 + # canonicalize_path() will return "" to make libsvn 1.5.x happy,
818 + $path = "." if $path eq "";
819 +
820 my $full_url = $url . ($path eq "." ? "" : "/$path");
821
822 if ($_url) {