about summary refs log tree commit homepage
path: root/lib/PublicInbox/Cgit.pm
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2021-03-18 23:27:51 +0000
committerEric Wong <e@80x24.org>2021-03-19 06:08:24 +0000
commit6890430df808488a42184844bb74331644772b09 (patch)
tree435ce48df55beef0e57c98c470af848e38c498c0 /lib/PublicInbox/Cgit.pm
parent86f7b16ee50081d4eed779372ccc198d8a1770dc (diff)
downloadpublic-inbox-6890430df808488a42184844bb74331644772b09.tar.gz
We can't completely instantiate our cgit wrapper without knowing
knowing cgit locations for serving static content.

Fixes: a5968dc059f655a ("config: lazy-load coderepos, support extindex")
Diffstat (limited to 'lib/PublicInbox/Cgit.pm')
-rw-r--r--lib/PublicInbox/Cgit.pm8
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/PublicInbox/Cgit.pm b/lib/PublicInbox/Cgit.pm
index f38e8b6b..8ad07be2 100644
--- a/lib/PublicInbox/Cgit.pm
+++ b/lib/PublicInbox/Cgit.pm
@@ -53,14 +53,18 @@ sub locate_cgit ($) {
 sub new {
         my ($class, $pi_cfg) = @_;
         my ($cgit_bin, $cgit_data) = locate_cgit($pi_cfg);
-
+        # TODO: support gitweb and other repository viewers?
+        if (defined(my $cgitrc = $pi_cfg->{-cgitrc_unparsed})) {
+                $pi_cfg->parse_cgitrc($cgitrc, 0);
+        }
         my $self = bless {
                 cmd => [ $cgit_bin ],
                 cgit_data => $cgit_data,
                 pi_cfg => $pi_cfg,
         }, $class;
 
-        $pi_cfg->fill_all; # fill in -code_repos mapped to inboxes
+        # fill in -code_repos mapped to inboxes
+        $pi_cfg->each_inbox($pi_cfg->can('repo_objs'));
 
         # some cgit repos may not be mapped to inboxes, so ensure those exist:
         my $code_repos = $pi_cfg->{-code_repos};