提交 5aacc63f 编写于 作者: B Ben Peart 提交者: Junio C Hamano

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: NBen Peart <Ben.Peart@microsoft.com>
Signed-off-by: NJunio C Hamano <gitster@pobox.com>
上级 ac6e12f9
......@@ -5,6 +5,7 @@
#include "pathspec.h"
#include "dir.h"
#include "fsmonitor.h"
#include "config.h"
#ifdef NO_PTHREADS
static void preload_index(struct index_state *index,
......@@ -84,7 +85,7 @@ static void preload_index(struct index_state *index,
return;
threads = index->cache_nr / THREAD_COST;
if ((index->cache_nr > 1) && (threads < 2) && getenv("GIT_FORCE_PRELOAD_TEST"))
if ((index->cache_nr > 1) && (threads < 2) && git_env_bool("GIT_FORCE_PRELOAD_TEST", 0))
threads = 2;
if (threads < 2)
return;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册