Loading cgitrc (and associated projects.list) can get users
out of defining as many individual coderepos.
xt/solver.t needs a use of `$_' replaced since that
gets clobbered while parsing cgitrc.
sub parse_cgitrc {
my ($self, $cgitrc, $nesting) = @_;
sub parse_cgitrc {
my ($self, $cgitrc, $nesting) = @_;
- $cgitrc //= $self->{'publicinbox.cgitrc'};
+ $cgitrc //= $self->{'publicinbox.cgitrc'} // return;
if ($nesting == 0) {
# defaults:
my %s = map { $_ => 1 } qw(/cgit.css /cgit.png
if ($nesting == 0) {
# defaults:
my %s = map { $_ => 1 } qw(/cgit.css /cgit.png
my ($self, $ibxish) = @_;
my $ibx_code_repos = $ibxish->{coderepo} // return;
$ibxish->{-repo_objs} // do {
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 $code_repos = $self->{-code_repos};
my @repo_objs;
for my $nick (@$ibx_code_repos) {
my $pi_cfg = $self->{pi_cfg};
# TODO: support gitweb and other repository viewers?
my $pi_cfg = $self->{pi_cfg};
# TODO: support gitweb and other repository viewers?
- defined($pi_cfg->{'publicinbox.cgitrc'}) and
- $pi_cfg->parse_cgitrc(undef, 0);
+ $pi_cfg->parse_cgitrc(undef, 0);
my $code_repos = $pi_cfg->{-code_repos};
for my $k (grep(/\Acoderepo\.(?:.+)\.dir\z/, keys %$pi_cfg)) {
my $code_repos = $pi_cfg->{-code_repos};
for my $k (grep(/\Acoderepo\.(?:.+)\.dir\z/, keys %$pi_cfg)) {
my ($ibx_name, $urls, @gone);
my $client = sub {
my ($cb) = @_;
my ($ibx_name, $urls, @gone);
my $client = sub {
my ($cb) = @_;
- for (@$urls) {
- my $url = "/$ibx_name/$_";
+ for my $u (@$urls) {
+ my $url = "/$ibx_name/$u";
my $res = $cb->(GET($url));
is($res->code, 200, $url);
next if $res->code == 200;
my $res = $cb->(GET($url));
is($res->code, 200, $url);
next if $res->code == 200;