about summary refs log tree commit homepage
path: root/lib/PublicInbox/RepoGitCommit.pm
diff options
context:
space:
mode:
Diffstat (limited to 'lib/PublicInbox/RepoGitCommit.pm')
-rw-r--r--lib/PublicInbox/RepoGitCommit.pm11
1 files changed, 5 insertions, 6 deletions
diff --git a/lib/PublicInbox/RepoGitCommit.pm b/lib/PublicInbox/RepoGitCommit.pm
index 8add3006..acac000e 100644
--- a/lib/PublicInbox/RepoGitCommit.pm
+++ b/lib/PublicInbox/RepoGitCommit.pm
@@ -135,19 +135,18 @@ sub call_git_commit { # RepoBase calls this
         $qsp->psgi_return($env, undef, sub { # parse header
                 my ($r, $bref) = @_;
                 if (!defined $r) {
-                        my $errmsg = $git->err;
-                        [ 500, [ 'Content-Type', 'text/html' ], [ $errmsg ] ];
+                        $self->rt(500, 'plain', $git->err);
                 } elsif ($r == 0) {
-                        git_commit_404($req);
+                        git_commit_404($self, $req);
                 } else {
                         $env->{'qspawn.filter'} = git_commit_sed($self, $req);
-                        [ 200, [ 'Content-Type', 'text/html' ] ];
+                        $self->rt(200, 'html');
                 }
         });
 }
 
 sub git_commit_404 {
-        my ($req) = @_;
+        my ($self, $req) = @_;
         my $x = 'Missing commit or path';
         my $pfx = "$req->{relcmd}commit";
 
@@ -156,7 +155,7 @@ sub git_commit_404 {
         $x .= "<a\nhref=\"$pfx\">$try the latest commit in HEAD</a>\n";
         $x .= '</pre></body>';
 
-        [404, ['Content-Type', 'text/html'], [ $x ]];
+        $self->rt(404, 'html', $x);
 }
 
 # FIXME: horrifically expensive...