-# Copyright (C) 2019 all contributors <meta@public-inbox.org>
+# Copyright (C) 2019-2020 all contributors <meta@public-inbox.org>
# License: AGPL-3.0+ <https://www.gnu.org/licenses/agpl-3.0.txt>
use strict;
use warnings;
require_git(2.6);
use PublicInbox::Spawn qw(popen_rd);
require_mods(qw(DBD::SQLite Search::Xapian Plack::Util));
-chomp(my $git_dir = `git rev-parse --git-dir 2>/dev/null`);
-plan skip_all => "$0 must be run from a git working tree" if $?;
+my $git_dir = xqx([qw(git rev-parse --git-dir)], undef, {2 => \(my $null)});
+$? == 0 or plan skip_all => "$0 must be run from a git working tree";
+chomp $git_dir;
# needed for alternates, and --absolute-git-dir is only in git 2.13+
$git_dir = abs_path($git_dir);
$im->{parallel} = 0;
my $deliver_patch = sub ($) {
- open my $fh, '<', $_[0] or die "open: $!";
- my $mime = PublicInbox::MIME->new(do { local $/; <$fh> });
+ my $mime = PublicInbox::InboxWritable::mime_from_path($_[0]) or
+ die "open $_[0]: $!";
$im->add($mime);
$im->done;
};
require_mods(@psgi, 7 + scalar(@psgi));
use_ok($_) for @psgi;
my $binfoo = "$inboxdir/binfoo.git";
- system(qw(git init --bare -q), $binfoo) == 0 or die "git init: $?";
+ require PublicInbox::Import;
+ PublicInbox::Import::init_bare($binfoo);
require_ok 'PublicInbox::ViewVCS';
my $big_size = do {
no warnings 'once';