Skip to contentSkip to conversation

git-svn: avoid fetching files outside of the URL we're tracking

PATCH New Eric Wong 1 participant 1 message Jun 15, 2016

lore
Share & tools
lore

Eric Wong

author
#0 lore raw

PATCH 1/1 git-svn: avoid fetching files outside of the URL we're tracking

Thanks to Santi <[email protected]> for the bug report and explanation:

Quoted 2 lines

/path/to/repository/project/file
/path/to/repository/project-2/file

<...>

Quoted 4 lines

you end up with a project with the following files:

file
-2/file

---
 contrib/git-svn/git-svn.perl |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
contrib/git-svn/git-svn.perl +1 -1
index 08e36be..6d49109 100755
@@ -2625,7 +2625,7 @@ sub libsvn_connect {
 sub libsvn_get_file {
 	my ($gui, $f, $rev) = @_;
 	my $p = $f;
-	return unless ($p =~ s#^\Q$SVN_PATH\E/?##);
+	return unless ($p =~ s#^\Q$SVN_PATH\E/##);
 
 	my ($hash, $pid, $in, $out);
 	my $pool = SVN::Pool->new;
Signature · 1 line
1.4.1.ge255