Skip to content

Commit 5765d97

Browse files
benpeartgitster
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 1f357b0 commit 5765d97

File tree

4 files changed

+7
-3
lines changed

4 files changed

+7
-3
lines changed

preload-index.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ static void preload_index(struct index_state *index,
8585
return;
8686

8787
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))
8989
threads = 2;
9090
if (threads < 2)
9191
return;

t/README

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -327,6 +327,9 @@ GIT_TEST_INDEX_VERSION=<n> exercises the index read/write code path
327327
for the index version specified. Can be set to any valid version
328328
(currently 2, 3, or 4).
329329

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+
330333
Naming Tests
331334
------------
332335

t/t7519-status-fsmonitor.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -238,9 +238,9 @@ do
238238
git config core.preloadIndex $preload_val &&
239239
if test $preload_val = true
240240
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
242242
else
243-
unset GIT_FORCE_PRELOAD_TEST
243+
sane_unset GIT_TEST_PRELOAD_INDEX
244244
fi
245245
'
246246

t/test-lib.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,7 @@ check_var_migration () {
154154

155155
check_var_migration GIT_FSMONITOR_TEST GIT_TEST_FSMONITOR
156156
check_var_migration TEST_GIT_INDEX_VERSION GIT_TEST_INDEX_VERSION
157+
check_var_migration GIT_FORCE_PRELOAD_TEST GIT_TEST_PRELOAD_INDEX
157158

158159
# Use specific version of the index file format
159160
if test -n "${GIT_TEST_INDEX_VERSION:+isset}"

0 commit comments

Comments
 (0)