+ is($? >> 8, 127, '--exit-code gave 127');
+ unlike($err, qr/git --git-dir=\S+ fetch/, 'no fetch done w/ manifest');
+ unlink("$d/t1/manifest.js.gz") or xbail "unlink $!";
+ my $before = [ glob("$d/t1/*") ];
+ ok(!run_script([qw(-fetch --exit-code -C), "$d/t1"], undef, $opt),
+ 'fetching v1 works w/o manifest.js.gz');
+ is($? >> 8, 127, '--exit-code gave 127');
+ unlink("$d/t1/FETCH_HEAD"); # git internal
+ like($err, qr/git --git-dir=\S+ fetch/, 'no fetch done w/ manifest');
+ ok(unlink("$d/t1/manifest.js.gz"), 'manifest created');
+ my $after = [ glob("$d/t1/*") ];
+ is_deeply($before, $after, 'no new files created');
+
+ local $ENV{HOME} = $tmpdir;
+ ok(run_script([qw(-index -Lbasic), "$d/t1"]), 'index v1');
+ ok(run_script([qw(-index -Lbasic), "$d/t2"]), 'index v2');
+
+ SKIP: {
+ join('', sort(keys %created)) eq 'v1v2' or
+ skip "lei didn't run", 2;
+ my $f = "$d/t1/public-inbox/msgmap.sqlite3";
+ my $ca = PublicInbox::Msgmap->new_file($f)->created_at;
+ is($ca, $created{v1}, 'clone + index v1 synced ->created_at');
+
+ $f = "$d/t2/msgmap.sqlite3";
+ $ca = PublicInbox::Msgmap->new_file($f)->created_at;
+ is($ca, $created{v2}, 'clone + index v2 synced ->created_at');
+ }
+ test_lei(sub {
+ lei_ok qw(inspect num:1 --dir), "$d/t1";
+ ok(ref(json_utf8->decode($lei_out)), 'inspect num: on v1');
+ lei_ok qw(inspect num:1 --dir), "$d/t2";
+ ok(ref(json_utf8->decode($lei_out)), 'inspect num: on v2');
+ });