Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2021-12-15 20:39:51 +0300
committerJunio C Hamano <gitster@pobox.com>2021-12-15 20:39:52 +0300
commit63a2e8b41e478a86fd98f86fe67b6f6d5b15f8cf (patch)
tree0cfc19ce4bca50ffd40f2e8588d91706d37527e2 /write-or-die.c
parentaa5937d2d9a52512133027ccd556083aad8bfedc (diff)
parent412e4caee387d825903bf1252aefbd5cf995a599 (diff)
Merge branch 'ew/test-wo-fsync'
Allow running our tests while disabling fsync. * ew/test-wo-fsync: tests: disable fsync everywhere
Diffstat (limited to 'write-or-die.c')
-rw-r--r--write-or-die.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/write-or-die.c b/write-or-die.c
index 0b1ec8190b..a3d5784cec 100644
--- a/write-or-die.c
+++ b/write-or-die.c
@@ -1,4 +1,5 @@
#include "cache.h"
+#include "config.h"
#include "run-command.h"
/*
@@ -57,6 +58,10 @@ void fprintf_or_die(FILE *f, const char *fmt, ...)
void fsync_or_die(int fd, const char *msg)
{
+ if (use_fsync < 0)
+ use_fsync = git_env_bool("GIT_TEST_FSYNC", 1);
+ if (!use_fsync)
+ return;
while (fsync(fd) < 0) {
if (errno != EINTR)
die_errno("fsync error on '%s'", msg);