Skip to content

Commit 5aacc63

Browse files
benpeartgitster
authored andcommitted
preload-index: use git_env_bool() not getenv() for customization
GIT_FORCE_PRELOAD_TEST is only checked for presence by using getenv(). Use git_env_bool() instead so that GIT_FORCE_PRELOAD_TEST=false can work as expected. Signed-off-by: Ben Peart <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent ac6e12f commit 5aacc63

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

preload-index.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
#include "pathspec.h"
66
#include "dir.h"
77
#include "fsmonitor.h"
8+
#include "config.h"
89

910
#ifdef NO_PTHREADS
1011
static void preload_index(struct index_state *index,
@@ -84,7 +85,7 @@ static void preload_index(struct index_state *index,
8485
return;
8586

8687
threads = index->cache_nr / THREAD_COST;
87-
if ((index->cache_nr > 1) && (threads < 2) && getenv("GIT_FORCE_PRELOAD_TEST"))
88+
if ((index->cache_nr > 1) && (threads < 2) && git_env_bool("GIT_FORCE_PRELOAD_TEST", 0))
8889
threads = 2;
8990
if (threads < 2)
9091
return;

0 commit comments

Comments
 (0)