about summary refs log tree commit homepage
path: root/lib/PublicInbox/WWW.pm
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2015-08-27 04:33:58 +0000
committerEric Wong <e@80x24.org>2015-08-27 06:04:51 +0000
commitded3c261112acf925567507959319a8442a3b647 (patch)
tree76fcba99b26ddd99361763623d286412c1e61ca9 /lib/PublicInbox/WWW.pm
parent1139d017d2b7dc97a7ce25aec204a8b454adc2a6 (diff)
downloadpublic-inbox-ded3c261112acf925567507959319a8442a3b647.tar.gz
Less scrolling is more efficient.
Diffstat (limited to 'lib/PublicInbox/WWW.pm')
-rw-r--r--lib/PublicInbox/WWW.pm8
1 files changed, 3 insertions, 5 deletions
diff --git a/lib/PublicInbox/WWW.pm b/lib/PublicInbox/WWW.pm
index d1ee2ff0..527d2131 100644
--- a/lib/PublicInbox/WWW.pm
+++ b/lib/PublicInbox/WWW.pm
@@ -138,7 +138,6 @@ sub mid2blob {
         my $path = PublicInbox::MID::mid2path($ctx->{mid});
         my @cmd = ('git', "--git-dir=$ctx->{git_dir}",
                         qw(cat-file blob), "HEAD:$path");
-        my $cmd = join(' ', @cmd);
         my $pid = open my $fh, '-|';
         defined $pid or die "fork failed: $!\n";
         if ($pid == 0) {
@@ -162,8 +161,7 @@ sub get_mid_txt {
 # /$LISTNAME/m/$MESSAGE_ID.html                   -> HTML content (short quotes)
 sub get_mid_html {
         my ($ctx) = @_;
-        my $x = mid2blob($ctx);
-        return r404() unless $x;
+        my $x = mid2blob($ctx) or return r404();
 
         require PublicInbox::View;
         my $pfx = msg_pfx($ctx);
@@ -178,8 +176,8 @@ sub get_mid_html {
 # /$LISTNAME/f/$MESSAGE_ID.html                   -> HTML content (fullquotes)
 sub get_full_html {
         my ($ctx) = @_;
-        my $x = mid2blob($ctx);
-        return r404() unless $x;
+        my $x = mid2blob($ctx) or return r404();
+
         require PublicInbox::View;
         my $foot = footer($ctx);
         require Email::MIME;