This is necessary for showing "found $OID in $CODEREPO_URL"
in solver-generated pages ($INBOX_URL/$OID/s/).
pi_cfg => $pi_cfg,
}, $class;
pi_cfg => $pi_cfg,
}, $class;
- # 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};
foreach my $k (keys %$pi_cfg) {
$k =~ /\Acoderepo\.(.+)\.dir\z/ or next;
my $dir = $pi_cfg->{$k};
# some cgit repos may not be mapped to inboxes, so ensure those exist:
my $code_repos = $pi_cfg->{-code_repos};
foreach my $k (keys %$pi_cfg) {
$k =~ /\Acoderepo\.(.+)\.dir\z/ or next;
my $dir = $pi_cfg->{$k};
- $code_repos->{$1} ||= PublicInbox::Git->new($dir);
+ $code_repos->{$1} ||= $pi_cfg->fill_code_repo($1);
}
while (my ($nick, $repo) = each %$code_repos) {
$self->{"\0$nick"} = $repo;
}
while (my ($nick, $repo) = each %$code_repos) {
$self->{"\0$nick"} = $repo;
cgit_repo_merge($self, $repo->{dir}, $repo) if $repo;
}
cgit_repo_merge($self, $repo->{dir}, $repo) if $repo;
}
-# parse a code repo
-# Only git is supported at the moment, but SVN and Hg are possibilities
-sub _fill_code_repo {
+# parse a code repo, only git is supported at the moment
+sub fill_code_repo {
my ($self, $nick) = @_;
my $pfx = "coderepo.$nick";
my $dir = $self->{"$pfx.dir"} // do { # aka "GIT_DIR"
my ($self, $nick) = @_;
my $pfx = "coderepo.$nick";
my $dir = $self->{"$pfx.dir"} // do { # aka "GIT_DIR"
next;
}
my $repo = $code_repos->{$nick} //=
next;
}
my $repo = $code_repos->{$nick} //=
- _fill_code_repo($self, $nick);
+ fill_code_repo($self, $nick);
push @repo_objs, $repo if $repo;
}
if (scalar @repo_objs) {
push @repo_objs, $repo if $repo;
}
if (scalar @repo_objs) {