From: Eric Wong Date: Fri, 3 Mar 2017 22:31:28 +0000 (+0000) Subject: repobrowse: raw: show the resulting tree for commits and tags X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=839d6fc6598473644f80056c1ebabad3fa05af63;p=thirdparty%2Fpublic-inbox.git 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. --- diff --git a/lib/PublicInbox/RepoGitRaw.pm b/lib/PublicInbox/RepoGitRaw.pm index 449934afc..858034a37 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'; }