+sub repo_objs {
+ my ($self, $ibxish) = @_;
+ my $ibx_code_repos = $ibxish->{coderepo} // return;
+ $ibxish->{-repo_objs} // do {
+ parse_cgitrc($self, undef, 0);
+ my $code_repos = $self->{-code_repos};
+ my @repo_objs;
+ for my $nick (@$ibx_code_repos) {
+ my @parts = split(m!/!, $nick);
+ for (@parts) {
+ @parts = () unless valid_foo_name($_);
+ }
+ unless (@parts) {
+ warn "invalid coderepo name: `$nick'\n";
+ next;
+ }
+ my $repo = $code_repos->{$nick} //=
+ fill_code_repo($self, $nick);
+ push @repo_objs, $repo if $repo;
+ }
+ if (scalar @repo_objs) {
+ require Scalar::Util;
+ for (@repo_objs) {
+ push @{$_->{-ibxs}}, $ibxish;
+ Scalar::Util::weaken($_->{-ibxs}->[-1]);
+ }
+ $ibxish->{-repo_objs} = \@repo_objs;
+ } else {
+ delete $ibxish->{coderepo};
+ }
+ }
+}
+
+sub _fill_ibx {
+ my ($self, $name) = @_;
+ my $pfx = "publicinbox.$name";
+ my $ibx = {};
+ for my $k (qw(watch)) {