Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 3 additions & 24 deletions git-cvsserver.perl
Original file line number Diff line number Diff line change
Expand Up @@ -4986,13 +4986,13 @@ sub gethistorydense
return $result;
}

=head2 escapeRefName
=head2 unescapeRefName

Apply an escape mechanism to compensate for characters that
Undo an escape mechanism to compensate for characters that
git ref names can have that CVS tags can not.

=cut
sub escapeRefName
sub unescapeRefName
{
my($self,$refName)=@_;

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

if(! $refName=~/^[1-9][0-9]*(\.[1-9][0-9]*)*$/)
{
$refName=~s/_-/_-u--/g;
$refName=~s/\./_-p-/g;
$refName=~s%/%_-s-%g;
$refName=~s/[^-_a-zA-Z0-9]/sprintf("_-%02x-",$1)/eg;
}
}

=head2 unescapeRefName

Undo an escape mechanism to compensate for characters that
git ref names can have that CVS tags can not.

=cut
sub unescapeRefName
{
my($self,$refName)=@_;

# see escapeRefName() for description of escape mechanism.

$refName=~s/_-([spu]|[0-9a-f][0-9a-f])-/unescapeRefNameChar($1)/eg;

# allowed tag names
Expand Down
Loading