]> Sergey Matveev's repositories - public-inbox.git/blobdiff - t/v2mirror.t
Merge remote-tracking branch 'origin/manifest' into next
[public-inbox.git] / t / v2mirror.t
index 283b2b228852f132f5ab3a3bb2480d81fa3f876f..c31dcd5bf7cdc2ed6c8df36ab89656eb70f8d7d2 100644 (file)
@@ -4,9 +4,10 @@ use strict;
 use warnings;
 use Test::More;
 require './t/common.perl';
+require_git(2.6);
 
 # Integration tests for HTTP cloning + mirroring
-foreach my $mod (qw(Plack::Util Plack::Builder Danga::Socket
+foreach my $mod (qw(Plack::Util Plack::Builder
                        HTTP::Date HTTP::Status Search::Xapian DBD::SQLite
                        IPC::Run)) {
        eval "require $mod";
@@ -16,6 +17,7 @@ use File::Temp qw/tempdir/;
 use IO::Socket;
 use POSIX qw(dup2);
 use_ok 'PublicInbox::V2Writable';
+use PublicInbox::InboxWritable;
 use PublicInbox::MIME;
 use PublicInbox::Config;
 # FIXME: too much setup
@@ -78,11 +80,13 @@ $sock = undef;
 
 my @cmd;
 foreach my $i (0..$epoch_max) {
-       @cmd = (qw(git clone --mirror -q), "http://$host:$port/v2/$i",
+       my $sfx = $i == 0 ? '.git' : '';
+       @cmd = (qw(git clone --mirror -q),
+               "http://$host:$port/v2/$i$sfx",
                "$tmpdir/m/git/$i.git");
 
-       is(system(@cmd), 0, 'cloned OK');
-       ok(-d "$tmpdir/m/git/$i.git", 'mirror OK');
+       is(system(@cmd), 0, "cloned $i.git");
+       ok(-d "$tmpdir/m/git/$i.git", "mirror $i OK");
 }
 
 @cmd = ("$script-init", '-V2', 'm', "$tmpdir/m", 'http://example.com/m',