environ: GIT_FLUSH should be made a usual Boolean

This uses atoi() and checks if the result is not zero to decide what to do. Turning it into the usual Boolean environment variable to use git_env_bool() would not break those who have been using "set to 0, or set to non-zero, that can be parsed with atoi()" values, but will match the expectation of those who expected "true" to mean "yes". Signed-off-by: Junio C Hamano <gitster@pobox.com>

Junio C Hamano committed Sep 15, 2022 at 09:06 UTC fd01795beb1bda7aa738b443bcb01cc9df70059a
2 files changed +2
Documentation/git.txt
+1
@@ -705,6 +705,7 @@ for further details.
705 waiting for someone with sufficient permissions to fix it.
706
707 `GIT_FLUSH`::
708 +// NEEDSWORK: make it into a usual Boolean environment variable
709 If this environment variable is set to "1", then commands such
710 as 'git blame' (in incremental mode), 'git rev-list', 'git log',
711 'git check-attr' and 'git check-ignore' will
write-or-die.c
+1
@@ -23,6 +23,7 @@ void maybe_flush_or_die(FILE *f, const char *desc)
23
24 if (f == stdout) {
25 if (skip_stdout_flush < 0) {
26 + /* NEEDSWORK: make this a normal Boolean */
27 cp = getenv("GIT_FLUSH");
28 if (cp)
29 skip_stdout_flush = (atoi(cp) == 0);