ok(-f "$t1/public-inbox/msgmap.sqlite3", 't1-mirror indexed');
is(PublicInbox::Inbox::try_cat("$t1/description"),
"mirror of $http/t1/\n", 'description set');
ok(-f "$t1/public-inbox/msgmap.sqlite3", 't1-mirror indexed');
is(PublicInbox::Inbox::try_cat("$t1/description"),
"mirror of $http/t1/\n", 'description set');
lei_ok('add-external', $t2, '--mirror', "$http/t2/", \'--mirror v2');
ok(-f "$t2/msgmap.sqlite3", 't2-mirror indexed');
ok(-f "$t2/description", 't2 description');
lei_ok('add-external', $t2, '--mirror', "$http/t2/", \'--mirror v2');
ok(-f "$t2/msgmap.sqlite3", 't2-mirror indexed');
ok(-f "$t2/description", 't2 description');
is(PublicInbox::Inbox::try_cat("$t2/description"),
"mirror of $http/t2/\n", 'description set');
is(PublicInbox::Inbox::try_cat("$t2/description"),
"mirror of $http/t2/\n", 'description set');
ok(!run_script([qw(-fetch --exit-code -C), "$d/t2"], undef, $opt),
'-fetch succeeds w/ manifest.js.gz');
is($? >> 8, 127, '--exit-code gave 127');
ok(!run_script([qw(-fetch --exit-code -C), "$d/t2"], undef, $opt),
'-fetch succeeds w/ manifest.js.gz');
is($? >> 8, 127, '--exit-code gave 127');
unlink("$d/t2/manifest.js.gz") or xbail "unlink $!";
ok(!run_script([qw(-fetch --exit-code -C), "$d/t2"], undef, $opt),
'-fetch succeeds w/o manifest.js.gz');
is($? >> 8, 127, '--exit-code gave 127');
unlink("$d/t2/manifest.js.gz") or xbail "unlink $!";
ok(!run_script([qw(-fetch --exit-code -C), "$d/t2"], undef, $opt),
'-fetch succeeds w/o manifest.js.gz');
is($? >> 8, 127, '--exit-code gave 127');
ok(run_script([qw(-clone -q -C), $d, "$http/t1"], undef, $opt),
'cloning v1 works');
ok(run_script([qw(-clone -q -C), $d, "$http/t1"], undef, $opt),
'cloning v1 works');
ok(!run_script([qw(-fetch --exit-code -C), "$d/t1"], undef, $opt),
'fetching v1 works');
is($? >> 8, 127, '--exit-code gave 127');
ok(!run_script([qw(-fetch --exit-code -C), "$d/t1"], undef, $opt),
'fetching v1 works');
is($? >> 8, 127, '--exit-code gave 127');
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
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
ok(unlink("$d/t1/manifest.js.gz"), 'manifest created');
my $after = [ glob("$d/t1/*") ];
is_deeply($before, $after, 'no new files created');
ok(unlink("$d/t1/manifest.js.gz"), 'manifest created');
my $after = [ glob("$d/t1/*") ];
is_deeply($before, $after, 'no new files created');