git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH 2/2] git svn: fix reparenting when ugly http(s) URLs are used

From
EWEric Wong <normalperson@yhbt.net>
Date
Jul 20, 2009, 05:58 UTC
Message-ID
<20090720055826.GB24393@dcvr.yhbt.net>
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>
---
 git-svn.perl |    6 ++++--
 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;
-- 
Eric Wong
Message 1 of 1 in “git svn: fix reparenting when ugly http(s) URLs are used”
  1. 2/2 git svn: fix reparenting when ugly http(s) URLs are usedEric Wong, Jul 20, 2009

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.