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

[PATCH] svn: Quote repository root in regex match

From
Ted Percival <ted.percival@quest.com>
Date
Oct 31, 2011, 22:37 UTC
Message-ID
<1320100632-10058-1-git-send-email-ted.percival@quest.com>

Fixes a problem matching repository URLs, especially those with a '+' in the URL, such as svn+ssh:// URLs. Parts of the URL were interpreted as special characters by the regex matching.

Signed-off-by: Ted Percival <ted.percival@quest.com>
---
 git-svn.perl |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/git-svn.perl b/git-svn.perl
index 351e743..4e95450 100755
--- a/git-svn.perl
+++ b/git-svn.perl
@@ -629,7 +629,7 @@ sub populate_merge_info {
 				fatal "merge commit $d has ancestor $parent, but that change "
                      ."does not have git-svn metadata!";
 			}
-			unless ($branchurl =~ /^$rooturl(.*)/) {
+			unless ($branchurl =~ /^\Q$rooturl\E(.*)/) {
 				fatal "commit $parent git-svn metadata changed mid-run!";
 			}
 			my $branchpath = $1;
@@ -791,7 +791,7 @@ sub cmd_dcommit {
 							 ."has uuid $uuid!";
 					}
 
-					unless ($branchurl =~ /^$rooturl(.*)/) {
+					unless ($branchurl =~ /^\Q$rooturl\E(.*)/) {
 						# This branch is very strange indeed.
 						fatal "merge parent $parent for $d is on branch "
 							 ."$branchurl, which is not under the "
-- 
1.7.7
Next: Eric Wong
Message 1 of 2 in “svn: Quote repository root in regex match”
  1. svn: Quote repository root in regex matchTed Percival, Oct 31, 2011
  2. Eric WongNov 1, 2011

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.