]> Sergey Matveev's repositories - public-inbox.git/blobdiff - lib/PublicInbox/Mbox.pm
rename 'GitCatFile' package to 'Git'
[public-inbox.git] / lib / PublicInbox / Mbox.pm
index 80e8efc978199cd9178e7fc441a286be020d29ff..0d67981f42a2e30e938f4ba3fa5ccf0f101f8087 100644 (file)
@@ -1,6 +1,8 @@
 # Copyright (C) 2015 all contributors <meta@public-inbox.org>
 # License: AGPLv3 or later (https://www.gnu.org/licenses/agpl-3.0.txt)
-# Streaming interface for formatting messages as an mboxrd
+
+# Streaming interface for formatting messages as an mboxrd.
+# Used by the web interface
 package PublicInbox::Mbox;
 use strict;
 use warnings;
@@ -84,9 +86,9 @@ sub emit_mbox {
        my $fh = $response->([200, ['Content-Type' => "application/$type"]]);
        $fh = PublicInbox::MboxGz->new($fh) if $sfx;
 
-       require PublicInbox::GitCatFile;
+       require PublicInbox::Git;
        my $mid = $ctx->{mid};
-       my $git = PublicInbox::GitCatFile->new($ctx->{git_dir});
+       my $git = $ctx->{git} ||= PublicInbox::Git->new($ctx->{git_dir});
        my %opts = (offset => 0);
        my $nr;
        do {