Seeing the raw tag or commit is not very useful, but people
tend to treat them as trees. This behavior is also shared
by the "plain" endpoint in cgit.
my $base = $req->{extra}->[-1];
$ct = $self->mime_type($base) if defined $base;
$ct ||= 'text/plain; charset=UTF-8' if !$size;
- } elsif ($type eq 'commit' || $type eq 'tag') {
- $ct = 'text/plain; charset=UTF-8';
- } elsif ($type eq 'tree') {
+ } elsif ($type eq 'commit' || $type eq 'tag' ||
+ $type eq 'tree') {
return git_tree_raw($self, $req, $res, $hex);
- } else {
+ } else { # hmm..., just in case
$ct = 'application/octet-stream';
}