Skip to content

Commit 67cae84

Browse files
opohorelgitster
authored andcommitted
cvsserver: remove unused escapeRefName function
Function 'escapeRefName' introduced in 51a7e6d 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 <[email protected]> Signed-off-by: Ondřej Pohořelský <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent f93ff17 commit 67cae84

File tree

1 file changed

+3
-24
lines changed

1 file changed

+3
-24
lines changed

git-cvsserver.perl

Lines changed: 3 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -4986,13 +4986,13 @@ sub gethistorydense
49864986
return $result;
49874987
}
49884988

4989-
=head2 escapeRefName
4989+
=head2 unescapeRefName
49904990
4991-
Apply an escape mechanism to compensate for characters that
4991+
Undo an escape mechanism to compensate for characters that
49924992
git ref names can have that CVS tags can not.
49934993
49944994
=cut
4995-
sub escapeRefName
4995+
sub unescapeRefName
49964996
{
49974997
my($self,$refName)=@_;
49984998

@@ -5009,27 +5009,6 @@ sub escapeRefName
50095009
# = "_-xx-" Where "xx" is the hexadecimal representation of the
50105010
# desired ASCII character byte. (for anything else)
50115011

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-
50335012
$refName=~s/_-([spu]|[0-9a-f][0-9a-f])-/unescapeRefNameChar($1)/eg;
50345013

50355014
# allowed tag names

0 commit comments

Comments
 (0)