preload-index: update GIT_FORCE_PRELOAD_TEST support

Rename GIT_FORCE_PRELOAD_TEST to GIT_TEST_PRELOAD_INDEX for consistency with the other GIT_TEST_ special setups and properly document its use. Add logic in t/test-lib.sh to give a warning when the old variable is set to let people know they need to update their environment to use the new variable. Signed-off-by: Ben Peart <Ben.Peart@microsoft.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Ben Peart committed Sep 18, 2018 at 23:29 UTC 5765d97b71d7489f927354e1704fc0d1d7ef90a0
4 files changed +7 -3
preload-index.c
+1 -1
@@ -85,7 +85,7 @@ static void preload_index(struct index_state *index,
85 return;
86
87 threads = index->cache_nr / THREAD_COST;
88 - if ((index->cache_nr > 1) && (threads < 2) && git_env_bool("GIT_FORCE_PRELOAD_TEST", 0))
88 + if ((index->cache_nr > 1) && (threads < 2) && git_env_bool("GIT_TEST_PRELOAD_INDEX", 0))
89 threads = 2;
90 if (threads < 2)
91 return;
t/README
+3
@@ -327,6 +327,9 @@ GIT_TEST_INDEX_VERSION=<n> exercises the index read/write code path
327 for the index version specified. Can be set to any valid version
328 (currently 2, 3, or 4).
329
330 +GIT_TEST_PRELOAD_INDEX=<boolean> exercises the preload-index code path
331 +by overriding the minimum number of cache entries required per thread.
332 +
333 Naming Tests
334 ------------
335
t/t7519-status-fsmonitor.sh
+2 -2
@@ -238,9 +238,9 @@ do
238 git config core.preloadIndex $preload_val &&
239 if test $preload_val = true
240 then
241 - GIT_FORCE_PRELOAD_TEST=$preload_val; export GIT_FORCE_PRELOAD_TEST
241 + GIT_TEST_PRELOAD_INDEX=$preload_val; export GIT_TEST_PRELOAD_INDEX
242 else
243 - unset GIT_FORCE_PRELOAD_TEST
243 + sane_unset GIT_TEST_PRELOAD_INDEX
244 fi
245 '
246
t/test-lib.sh
+1
@@ -154,6 +154,7 @@ check_var_migration () {
154
155 check_var_migration GIT_FSMONITOR_TEST GIT_TEST_FSMONITOR
156 check_var_migration TEST_GIT_INDEX_VERSION GIT_TEST_INDEX_VERSION
157 +check_var_migration GIT_FORCE_PRELOAD_TEST GIT_TEST_PRELOAD_INDEX
158
159 # Use specific version of the index file format
160 if test -n "${GIT_TEST_INDEX_VERSION:+isset}"