Skip to content

Commit 4c2db93

Browse files
pcloudsgitster
authored andcommitted
read-cache.c: make $GIT_TEST_SPLIT_INDEX boolean
While at there, document about this special mode when running the test suite. Signed-off-by: Nguyễn Thái Ngọc Duy <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent fe0a9ea commit 4c2db93

File tree

3 files changed

+14
-3
lines changed

3 files changed

+14
-3
lines changed

ci/run-build-and-tests.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ make --jobs=2
1111
make --quiet test
1212
if test "$jobname" = "linux-gcc"
1313
then
14-
GIT_TEST_SPLIT_INDEX=YesPlease make --quiet test
14+
GIT_TEST_SPLIT_INDEX=yes make --quiet test
1515
fi
1616

1717
check_unignored_build_artifacts

read-cache.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2268,7 +2268,7 @@ static int do_write_index(struct index_state *istate, struct tempfile *tempfile,
22682268

22692269
if (!istate->version) {
22702270
istate->version = get_index_format_default();
2271-
if (getenv("GIT_TEST_SPLIT_INDEX"))
2271+
if (git_env_bool("GIT_TEST_SPLIT_INDEX", 0))
22722272
init_split_index(istate);
22732273
}
22742274

@@ -2559,7 +2559,7 @@ int write_locked_index(struct index_state *istate, struct lock_file *lock,
25592559
goto out;
25602560
}
25612561

2562-
if (getenv("GIT_TEST_SPLIT_INDEX")) {
2562+
if (git_env_bool("GIT_TEST_SPLIT_INDEX", 0)) {
25632563
int v = si->base_sha1[0];
25642564
if ((v & 15) < 6)
25652565
istate->cache_changed |= SPLIT_INDEX_ORDERED;

t/README

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -293,6 +293,17 @@ and know what setup is needed for it. Or when you want to run
293293
everything up to a certain test.
294294

295295

296+
Running tests with special setups
297+
---------------------------------
298+
299+
The whole test suite could be run to test some special features
300+
that cannot be easily covered by a few specific test cases. These
301+
could be enabled by running the test suite with correct GIT_TEST_
302+
environment set.
303+
304+
GIT_TEST_SPLIT_INDEX=<boolean> forces split-index mode on the whole
305+
test suite. Accept any boolean values that are accepted by git-config.
306+
296307
Naming Tests
297308
------------
298309

0 commit comments

Comments
 (0)