- my $code_repos = $pi_config->{-code_repos};
- foreach my $k (keys %$pi_config) {
- $k =~ /\Acoderepo\.(.+)\.dir\z/ or next;
- my $dir = $pi_config->{$k};
- $code_repos->{$1} ||= PublicInbox::Git->new($dir);
- }
- while (my ($nick, $repo) = each %$code_repos) {
- $self->{"\0$nick"} = $repo;
- }
- my $cgit_static = $pi_config->{-cgit_static};
- my $static = join('|', map { quotemeta $_ } keys %$cgit_static);
- $self->{static} = qr/\A($static)\z/;
+ PublicInbox::WwwCoderepo::prepare_coderepos($self);
+ my $s = join('|', map { quotemeta } keys %{$pi_cfg->{-cgit_static}});
+ $self->{static} = qr/\A($s)\z/;