about summary refs log tree commit homepage
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2017-03-03 22:31:28 +0000
committerEric Wong <e@80x24.org>2017-03-03 22:31:28 +0000
commit839d6fc6598473644f80056c1ebabad3fa05af63 (patch)
treeedea8b25385fe9fe691dfe14bc082bf0a2aee846
parent696cb7392e0de52e7c9fa103c62c1672646f3fb3 (diff)
downloadpublic-inbox-839d6fc6598473644f80056c1ebabad3fa05af63.tar.gz
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.
-rw-r--r--lib/PublicInbox/RepoGitRaw.pm7
1 files 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';
                 }