]> git.ipfire.org Git - thirdparty/public-inbox.git/commitdiff
config: don't vivify invalid fields for coderepos
authorEric Wong <e@80x24.org>
Tue, 16 Jan 2024 11:52:53 +0000 (11:52 +0000)
committerEric Wong <e@80x24.org>
Wed, 17 Jan 2024 09:37:54 +0000 (09:37 +0000)
We don't need 404s for non-existent coderepos creating fake
(and invalid) entries.  I noticed this while working on
subsequent changes to support globbing in URLs.

lib/PublicInbox/Config.pm

index 6bebf790bd15898b67c734cd93e53d9cde695462..33c59ec7aaaec3d5cd5c9e923b735e3ad6838e81 100644 (file)
@@ -699,8 +699,8 @@ sub get_coderepo {
        $self->{-coderepos}->{$nick} // do {
                defined($self->{-cgit_scan_path}) ? do {
                        apply_cgit_scan_path($self);
-                       $self->{-coderepos}->{$nick} =
-                                       fill_coderepo($self, $nick);
+                       my $cr = fill_coderepo($self, $nick);
+                       $cr ? ($self->{-coderepos}->{$nick} = $cr) : undef;
                } : undef;
        };
 }