# Copyright (C) 2018-2021 all contributors <meta@public-inbox.org>
# License: AGPL-3.0+ <https://www.gnu.org/licenses/agpl-3.0.txt>
use strict;
-use warnings;
-use Test::More;
+use v5.10.1;
use PublicInbox::TestCommon;
use File::Path qw(remove_tree);
use Cwd qw(abs_path);
require_git(2.6);
+require_cmd('curl');
local $ENV{HOME} = abs_path('t');
# Integration tests for HTTP cloning + mirroring
require_mods(qw(Plack::Util Plack::Builder
HTTP::Date HTTP::Status Search::Xapian DBD::SQLite));
-use IO::Socket;
-use POSIX qw(dup2);
use_ok 'PublicInbox::V2Writable';
use PublicInbox::InboxWritable;
use PublicInbox::Eml;
my @new_epochs;
my $fetch_each_epoch = sub {
my %before = map { $_ => 1 } glob("$tmpdir/m/git/*");
- run_script([qw(-fetch -q)], undef, {-C => "$tmpdir/m"}) or
+ run_script([qw(-fetch --exit-code -q)], undef, {-C => "$tmpdir/m"}) or
xbail '-fetch fail';
+ is($?, 0, '--exit-code 0 after fetch updated');
my @after = grep { !$before{$_} } glob("$tmpdir/m/git/*");
push @new_epochs, @after;
};
is(scalar($mset->items), 0, 'large message not re-indexed');
}
ok(scalar(@new_epochs), 'new epochs were created and fetched');
+for my $d (@new_epochs) {
+ is(xqx(['git', "--git-dir=$d", 'config', qw(include.path)]),
+ "../../all.git/config\n",
+ 'include.path set');
+}
ok($td->kill, 'killed httpd');
$td->join;
-done_testing();
-
-1;
+done_testing;