As with git itself, fsync(2) results in needless overhead and
storage wear in test cases where data integrity is not an issue.
I normally point TMPDIR to tmpfs when running tests, but this
still affects initial setup of data for stuff in t/data-gen as
well as improving life for users with too little RAM for a tmpfs
TMPDIR.
our ($lei_opt, $lei_out, $lei_err);
use autodie qw(chdir close fcntl mkdir open opendir seek unlink);
$ENV{XDG_CACHE_HOME} //= "$ENV{HOME}/.cache"; # reuse C++ xap_helper builds
+$ENV{GIT_TEST_FSYNC} = 0; # hopefully reduce wear
$_ = File::Spec->rel2abs($_) for (grep(!m!^/!, @INC));
our $CURRENT_DAEMON;
my ($base) = @_;
require File::Temp;
($base) = ($0 =~ m!\b([^/]+)\.[^\.]+\z!) unless defined $base;
+ ($base) = ($0 =~ m!\b([^/]+)\z!) unless defined $base;
my $tmpdir = File::Temp->newdir("pi-$base-$$-XXXX", TMPDIR => 1);
wantarray ? ($tmpdir->dirname, $tmpdir) : $tmpdir;
}