From: Eric Wong Date: Fri, 23 Dec 2016 01:14:01 +0000 (+0000) Subject: git-svn: escape backslashes in refnames X-Git-Tag: v2.12.0~8^2 X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/22af6fef9b6538c9e87e147a920be9509acf1ddd git-svn: escape backslashes in refnames This brings git-svn refname escaping up-to-date with commit a4c2e69936df8dd0b071b85664c6cc6a4870dd84 ("Disallow '\' in ref names") from May 2009. Reported-by: Michael Fladischer Message-ID: Signed-off-by: Eric Wong --- diff --git a/perl/Git/SVN.pm b/perl/Git/SVN.pm index 711d2687a3..98518f4ddb 100644 --- a/perl/Git/SVN.pm +++ b/perl/Git/SVN.pm @@ -490,7 +490,7 @@ sub refname { # # Additionally, % must be escaped because it is used for escaping # and we want our escaped refname to be reversible - $refname =~ s{([ \%~\^:\?\*\[\t])}{sprintf('%%%02X',ord($1))}eg; + $refname =~ s{([ \%~\^:\?\*\[\t\\])}{sprintf('%%%02X',ord($1))}eg; # no slash-separated component can begin with a dot . # /.* becomes /%2E*