untracked cache: use git_env_bool() not getenv() for customization
commit026336cb277693c5a8cdfa4705a26daf0a754328
authorJunio C Hamano <gitster@pobox.com>
Wed, 28 Feb 2018 21:21:09 +0000 (28 13:21 -0800)
committerJunio C Hamano <gitster@pobox.com>
Wed, 28 Feb 2018 21:27:10 +0000 (28 13:27 -0800)
tree9667307626792a63ec204d7b3317e1287e8a8536
parentfc9ecbeb93d3c4fae2439e1d9c5346052a1796c2
untracked cache: use git_env_bool() not getenv() for customization

GIT_DISABLE_UNTRACKED_CACHE and GIT_TEST_UNTRACKED_CACHE are only
sensed for their presense by using getenv(); use git_env_bool()
instead so that GIT_DISABLE_UNTRACKED_CACHE=false would work as
naïvely expected.

Also rename GIT_TEST_UNTRACKED_CACHE to GIT_FORCE_UNTRACKED_CACHE
to express what it does more honestly.  Forcing its use may be one
useful thing to do while testing the feature, but testing does not
have to be the only use of the knob.

While at it, avoid repeated calls to git_env_bool() by capturing the
return value from the first call in a static variable.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
dir.c
t/t7063-status-untracked-cache.sh