summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Wong <normalperson@yhbt.net>2009-07-20 05:08:45 (GMT)
committerEric Wong <normalperson@yhbt.net>2009-07-20 05:50:06 (GMT)
commit2a679c7a3148978a3f58f1c12100383638e744c5 (patch)
treef3a31dcbe512f5e0e82992d121118e4ebb750107
parentf0e8b1a3ed48716fa48c93f64214da1ee20ed534 (diff)
downloadgit-2a679c7a3148978a3f58f1c12100383638e744c5.zip
git-2a679c7a3148978a3f58f1c12100383638e744c5.tar.gz
git-2a679c7a3148978a3f58f1c12100383638e744c5.tar.bz2
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>
-rwxr-xr-xgit-svn.perl6
1 files changed, 4 insertions, 2 deletions
diff --git a/git-svn.perl b/git-svn.perl
index cfade63..43c86e8 100755
--- a/git-svn.perl
+++ b/git-svn.perl
@@ -4525,10 +4525,12 @@ sub gs_do_switch {
my $full_url = $self->{url};
my $old_url = $full_url;
- $full_url .= '/' . escape_uri_only($path) if length $path;
+ $full_url .= '/' . $path if length $path;
my ($ra, $reparented);
- if ($old_url =~ m#^svn(\+ssh)?://#) {
+ if ($old_url =~ m#^svn(\+ssh)?://# ||
+ ($full_url =~ m#^https?://# &&
+ escape_url($full_url) ne $full_url)) {
$_[0] = undef;
$self = undef;
$RA = undef;