Skip to content

Commit 884cce5

Browse files
author
Eric Wong
committed
git svn: avoid escaping '/' when renaming/copying files
Timothy Schaeffer reported the following: > Git-svn has been giving me the following error for some time > when calling "git svn dcommit": > > RA layer request failed: PROPFIND request failed on > '/svn/stf/branches/dev/sw%2Fdpemu%2Finclude%2FNetCnxn.h': PROPFIND of > '/svn/stf/branches/dev/sw%2Fdpemu%2Finclude%2FNetCnxn.h': 302 Found > (https://oursvnrepo.net) at /usr/local/libexec/git-core/git-svn line 508 > > This only occurred when git detected a rename or copy. > > Following the lead into git-svn.perl, > and noticing that some of the '/'s in the path were hex-encoded > and some were not, > I changed the regex used to find chars > to hex-encode in the relative part of the path > to exclude '/'. > It works, so far. > I have included a patch. While this has previous not been a problem in my experience, newer versions of SVN may be stricter and this does not introduce regressions in t9115. Signed-off-by: Eric Wong <[email protected]>
1 parent 5af9b77 commit 884cce5

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

git-svn.perl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4005,7 +4005,7 @@ sub repo_path {
40054005
sub url_path {
40064006
my ($self, $path) = @_;
40074007
if ($self->{url} =~ m#^https?://#) {
4008-
$path =~ s/([^~a-zA-Z0-9_.-])/uc sprintf("%%%02x",ord($1))/eg;
4008+
$path =~ s!([^~a-zA-Z0-9_./-])!uc sprintf("%%%02x",ord($1))!eg;
40094009
}
40104010
$self->{url} . '/' . $self->repo_path($path);
40114011
}

0 commit comments

Comments
 (0)