git-svn: remove ad-hoc canonicalizations

[ew: commit title] Signed-off-by: Eric Wong <normalperson@yhbt.net>

Michael G. Schwern committed Jul 28, 2012 at 02:47 UTC 5eaa1fd086e826b1ac8d9346a740527edbdb3c34
2 files changed +4 -5
git-svn.perl
+4 -4
@@ -36,6 +36,7 @@ use Git::SVN::Utils qw(
36 canonicalize_url
37 join_paths
38 add_path_to_url
39 + join_paths
40 );
41
42 use Git qw(
@@ -1598,7 +1599,7 @@ sub post_fetch_checkout {
1599
1600 sub complete_svn_url {
1601 my ($url, $path) = @_;
1601 - $path =~ s#/+$##;
1602 + $path = canonicalize_path($path);
1603
1604 # If the path is not a URL...
1605 if ($path !~ m#^[a-z\+]+://#) {
@@ -1617,7 +1618,7 @@ sub complete_url_ls_init {
1618 print STDERR "W: $switch not specified\n";
1619 return;
1620 }
1620 - $repo_path =~ s#/+$##;
1621 + $repo_path = canonicalize_path($repo_path);
1622 if ($repo_path =~ m#^[a-z\+]+://#) {
1623 $ra = Git::SVN::Ra->new($repo_path);
1624 $repo_path = '';
@@ -1638,9 +1639,8 @@ sub complete_url_ls_init {
1639 }
1640 command_oneline('config', $k, $gs->url) unless $orig_url;
1641
1641 - my $remote_path = $gs->path . "/$repo_path";
1642 + my $remote_path = join_paths( $gs->path, $repo_path );
1643 $remote_path =~ s{%([0-9A-F]{2})}{chr hex($1)}ieg;
1643 - $remote_path =~ s#/+#/#g;
1644 $remote_path =~ s#^/##g;
1645 $remote_path .= "/*" if $remote_path !~ /\*/;
1646 my ($n) = ($switch =~ /^--(\w+)/);
perl/Git/SVN.pm
-1
@@ -460,7 +460,6 @@ sub new {
460 }
461 {
462 my $path = $self->path;
463 - $path =~ s{/+}{/}g;
463 $path =~ s{\A/}{};
464 $path =~ s{/\z}{};
465 $self->path($path);