]> Sergey Matveev's repositories - public-inbox.git/blobdiff - t/solver_git.t
tests: replace mime_from_path with mime_load
[public-inbox.git] / t / solver_git.t
index b5231d2cbc30749e55726bbaff647ef42be6507d..c483aba176a1fdd7b398cbe0eeb173a4d41129cd 100644 (file)
@@ -8,8 +8,9 @@ use PublicInbox::TestCommon;
 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);
@@ -28,9 +29,7 @@ my $im = PublicInbox::V2Writable->new($ibx, 1);
 $im->{parallel} = 0;
 
 my $deliver_patch = sub ($) {
-       my $mime = PublicInbox::InboxWritable::mime_from_path($_[0]) or
-               die "open $_[0]: $!";
-       $im->add($mime);
+       $im->add(mime_load($_[0]));
        $im->done;
 };