my ($self, $range) = @_;
my $git = $self->{git};
+ if (index($range, '..') < 0) {
+ # don't show annoying git errrors to users who run -index
+ # on empty inboxes
+ $git->qx(qw(rev-parse -q --verify), "$range^0");
+ if ($?) {
+ open my $fh, '<', '/dev/null' or
+ die "failed to open /dev/null: $!\n";
+ return $fh;
+ }
+ }
+
# Count the new files so they can be added newest to oldest
# and still have numbers increasing from oldest to newest
my $fcount = 0;
my $git_dir = git_dir_n($self, $i);
-d $git_dir or next; # missing parts are fine
my $git = PublicInbox::Git->new($git_dir);
- chomp(my $tip = $git->qx('rev-parse', $head));
+ chomp(my $tip = $git->qx(qw(rev-parse -q --verify), $head));
+ next if $?; # new repo
my $range;
if (defined(my $cur = $ranges->[$i])) {
$range = "$cur..$tip";
my @cmd = ('blib/script/public-inbox-init', "-$v", $v, $mainrepo,
"http://example.com/$v", $addr);
is(system(@cmd), 0, 'public-inbox init OK');
- if ($v eq 'V1') {
- is(system('blib/script/public-inbox-index', $mainrepo), 0);
- }
+ is(system('blib/script/public-inbox-index', $mainrepo), 0);
is(system(@cfg, "$cfgpfx.filter", 'PublicInbox::Filter::RubyLang'), 0);
is(system(@cfg, "$cfgpfx.altid",
'serial:alerts:file=msgmap.sqlite3'), 0);