From 839d6fc6598473644f80056c1ebabad3fa05af63 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Fri, 3 Mar 2017 22:31:28 +0000 Subject: repobrowse: raw: show the resulting tree for commits and tags 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. --- lib/PublicInbox/RepoGitRaw.pm | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/lib/PublicInbox/RepoGitRaw.pm b/lib/PublicInbox/RepoGitRaw.pm index 449934af..858034a3 100644 --- a/lib/PublicInbox/RepoGitRaw.pm +++ b/lib/PublicInbox/RepoGitRaw.pm @@ -22,11 +22,10 @@ sub git_raw_check_res ($$$) { 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'; } -- cgit v1.2.3-24-ge0c7