Skip to content

Commit 22af6fe

Browse files
author
Eric Wong
committed
git-svn: escape backslashes in refnames
This brings git-svn refname escaping up-to-date with commit a4c2e69 ("Disallow '\' in ref names") from May 2009. Reported-by: Michael Fladischer <michael@fladi.at> Message-ID: <cb8cd9b1-9882-64d2-435d-40d0b2b82d59@fladi.at> Signed-off-by: Eric Wong <e@80x24.org>
1 parent a274e0a commit 22af6fe

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

perl/Git/SVN.pm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -490,7 +490,7 @@ sub refname {
490490
#
491491
# Additionally, % must be escaped because it is used for escaping
492492
# and we want our escaped refname to be reversible
493-
$refname =~ s{([ \%~\^:\?\*\[\t])}{sprintf('%%%02X',ord($1))}eg;
493+
$refname =~ s{([ \%~\^:\?\*\[\t\\])}{sprintf('%%%02X',ord($1))}eg;
494494

495495
# no slash-separated component can begin with a dot .
496496
# /.* becomes /%2E*

0 commit comments

Comments
 (0)