Git fork

cvsserver: remove unused escapeRefName function

Function 'escapeRefName' introduced in 51a7e6dbc9 has never been used.

Despite being dead code, changes in Perl 5.41.4 exposed precedence
warning within its logic, which then caused test failures in t9402 by
logging the warnings to stderr while parsing the code. The affected
tests are t9402.30, t9402.31, t9402.32 and t9402.34.

Remove this unused function to simplify the codebase and stop the
warnings and test failures. Its corresponding unescapeRefName function,
which remains in use, has had its comments updated.

Reported-by: Jitka Plesnikova <jplesnik@redhat.com>
Signed-off-by: Ondřej Pohořelský <opohorel@redhat.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

authored by

Ondřej Pohořelský and committed by
Junio C Hamano
67cae845 f93ff170

+3 -24
+3 -24
git-cvsserver.perl
··· 4986 return $result; 4987 } 4988 4989 - =head2 escapeRefName 4990 4991 - Apply an escape mechanism to compensate for characters that 4992 git ref names can have that CVS tags can not. 4993 4994 =cut 4995 - sub escapeRefName 4996 { 4997 my($self,$refName)=@_; 4998 ··· 5008 # a tag name. 5009 # = "_-xx-" Where "xx" is the hexadecimal representation of the 5010 # desired ASCII character byte. (for anything else) 5011 - 5012 - if(! $refName=~/^[1-9][0-9]*(\.[1-9][0-9]*)*$/) 5013 - { 5014 - $refName=~s/_-/_-u--/g; 5015 - $refName=~s/\./_-p-/g; 5016 - $refName=~s%/%_-s-%g; 5017 - $refName=~s/[^-_a-zA-Z0-9]/sprintf("_-%02x-",$1)/eg; 5018 - } 5019 - } 5020 - 5021 - =head2 unescapeRefName 5022 - 5023 - Undo an escape mechanism to compensate for characters that 5024 - git ref names can have that CVS tags can not. 5025 - 5026 - =cut 5027 - sub unescapeRefName 5028 - { 5029 - my($self,$refName)=@_; 5030 - 5031 - # see escapeRefName() for description of escape mechanism. 5032 5033 $refName=~s/_-([spu]|[0-9a-f][0-9a-f])-/unescapeRefNameChar($1)/eg; 5034
··· 4986 return $result; 4987 } 4988 4989 + =head2 unescapeRefName 4990 4991 + Undo an escape mechanism to compensate for characters that 4992 git ref names can have that CVS tags can not. 4993 4994 =cut 4995 + sub unescapeRefName 4996 { 4997 my($self,$refName)=@_; 4998 ··· 5008 # a tag name. 5009 # = "_-xx-" Where "xx" is the hexadecimal representation of the 5010 # desired ASCII character byte. (for anything else) 5011 5012 $refName=~s/_-([spu]|[0-9a-f][0-9a-f])-/unescapeRefNameChar($1)/eg; 5013