git svn: fix reparenting when ugly http(s) URLs are used
Mishandling of http(s) in need of escaping was causing t9118-git-svn-funky-branch-names to fail when SVN_HTTPD_PORT was defined. This bug was exposed in (but not caused by) commit 0b2af457a49e3b00d47d556d5301934d27909db8 (Fix branch detection when repository root is inaccessible) Signed-off-by: Eric Wong <normalperson@yhbt.net>
Eric Wong committed
Jul 19, 2009 at 22:08 UTC
2a679c7a3148978a3f58f1c12100383638e744c5
1 file changed
+4
-2
git-svn.perl
+4
-2
@@ -4525,10 +4525,12 @@ sub gs_do_switch {
4525
4526
my $full_url = $self->{url};
4527
my $old_url = $full_url;
4528
- $full_url .= '/' . escape_uri_only($path) if length $path;
4528
+ $full_url .= '/' . $path if length $path;
4529
my ($ra, $reparented);
4530
4531
- if ($old_url =~ m#^svn(\+ssh)?://#) {
4531
+ if ($old_url =~ m#^svn(\+ssh)?://# ||
4532
+ ($full_url =~ m#^https?://# &&
4533
+ escape_url($full_url) ne $full_url)) {
4534
$_[0] = undef;
4535
$self = undef;
4536
$RA = undef;