about summary refs log tree commit homepage
path: root/lib/PublicInbox/ManifestJsGz.pm
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2020-11-23 07:05:54 +0000
committerEric Wong <e@80x24.org>2020-11-24 05:03:55 +0000
commite917c6756d4912046aa6ad5130f6873d1873ddc7 (patch)
tree4addddd13f1599fbc072ae8bb4579e868fe75d94 /lib/PublicInbox/ManifestJsGz.pm
parentc118d783a22a2080964899266c91c1a1ac69f481 (diff)
downloadpublic-inbox-e917c6756d4912046aa6ad5130f6873d1873ddc7.tar.gz
manifest: use ibx->git_epoch method for v2
We can slightly reduce the amount of version-specific logic,
here.
Diffstat (limited to 'lib/PublicInbox/ManifestJsGz.pm')
-rw-r--r--lib/PublicInbox/ManifestJsGz.pm12
1 files changed, 5 insertions, 7 deletions
diff --git a/lib/PublicInbox/ManifestJsGz.pm b/lib/PublicInbox/ManifestJsGz.pm
index 3d8a38ae..3b436827 100644
--- a/lib/PublicInbox/ManifestJsGz.pm
+++ b/lib/PublicInbox/ManifestJsGz.pm
@@ -7,9 +7,7 @@ use strict;
 use v5.10.1;
 use parent qw(PublicInbox::WwwListing);
 use bytes (); # length
-use PublicInbox::Inbox;
 use PublicInbox::Config;
-use PublicInbox::Git;
 use IO::Compress::Gzip qw(gzip);
 use HTTP::Date qw(time2str);
 
@@ -26,15 +24,15 @@ sub url_regexp {
 sub manifest_add ($$;$$) {
         my ($ctx, $ibx, $epoch, $default_desc) = @_;
         my $url_path = "/$ibx->{name}";
-        my $git_dir = $ibx->{inboxdir};
+        my $git;
         if (defined $epoch) {
-                $git_dir .= "/git/$epoch.git";
                 $url_path .= "/git/$epoch.git";
+                $git = $ibx->git_epoch($epoch) or return;
+        } else {
+                $git = $ibx->git;
         }
-        return unless -d $git_dir;
-        my $git = PublicInbox::Git->new($git_dir);
         my $ent = $git->manifest_entry($epoch, $default_desc) or return;
-        $ctx->{-abs2urlpath}->{$git_dir} = $url_path;
+        $ctx->{-abs2urlpath}->{$git->{git_dir}} = $url_path;
         my $modified = $ent->{modified};
         if ($modified > ($ctx->{-mtime} // 0)) {
                 $ctx->{-mtime} = $modified;