-use File::Temp qw/tempdir/;
-my $dir = tempdir('pi-git-XXXXXX', TMPDIR => 1, CLEANUP => 1);
+use PublicInbox::TestCommon;
+my ($dir, $for_destroy) = tmpdir();
use_ok 'PublicInbox::Git';
{
is(system(qw(git init -q --bare), $dir), 0, 'created git directory');
use_ok 'PublicInbox::Git';
{
is(system(qw(git init -q --bare), $dir), 0, 'created git directory');
my $fi_data = './t/git.fast-import-data';
ok(-r $fi_data, "fast-import data readable (or run test at top level)");
my $fi_data = './t/git.fast-import-data';
ok(-r $fi_data, "fast-import data readable (or run test at top level)");
- my $buf = '';
- IPC::Run::run($cmd, '<', $big_data, '>', \$buf);
+ my $buf = do {
+ local $ENV{GIT_DIR} = $dir;
+ `git hash-object -w --stdin <$big_data`;
+ };
my @cmd = ('git', "--git-dir=$alt", qw(hash-object -w --stdin));
is(system(qw(git init -q --bare), $alt), 0, 'create alt directory');
open my $fh, '<', "$alt/config" or die "open failed: $!\n";
my @cmd = ('git', "--git-dir=$alt", qw(hash-object -w --stdin));
is(system(qw(git init -q --bare), $alt), 0, 'create alt directory');
open my $fh, '<', "$alt/config" or die "open failed: $!\n";