提交 4c2db938 编写于 作者: N Nguyễn Thái Ngọc Duy 提交者: Junio C Hamano

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: NNguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: NJunio C Hamano <gitster@pobox.com>
上级 fe0a9eaf
...@@ -11,7 +11,7 @@ make --jobs=2 ...@@ -11,7 +11,7 @@ make --jobs=2
make --quiet test make --quiet test
if test "$jobname" = "linux-gcc" if test "$jobname" = "linux-gcc"
then then
GIT_TEST_SPLIT_INDEX=YesPlease make --quiet test GIT_TEST_SPLIT_INDEX=yes make --quiet test
fi fi
check_unignored_build_artifacts check_unignored_build_artifacts
......
...@@ -2268,7 +2268,7 @@ static int do_write_index(struct index_state *istate, struct tempfile *tempfile, ...@@ -2268,7 +2268,7 @@ static int do_write_index(struct index_state *istate, struct tempfile *tempfile,
if (!istate->version) { if (!istate->version) {
istate->version = get_index_format_default(); istate->version = get_index_format_default();
if (getenv("GIT_TEST_SPLIT_INDEX")) if (git_env_bool("GIT_TEST_SPLIT_INDEX", 0))
init_split_index(istate); init_split_index(istate);
} }
...@@ -2559,7 +2559,7 @@ int write_locked_index(struct index_state *istate, struct lock_file *lock, ...@@ -2559,7 +2559,7 @@ int write_locked_index(struct index_state *istate, struct lock_file *lock,
goto out; goto out;
} }
if (getenv("GIT_TEST_SPLIT_INDEX")) { if (git_env_bool("GIT_TEST_SPLIT_INDEX", 0)) {
int v = si->base_sha1[0]; int v = si->base_sha1[0];
if ((v & 15) < 6) if ((v & 15) < 6)
istate->cache_changed |= SPLIT_INDEX_ORDERED; istate->cache_changed |= SPLIT_INDEX_ORDERED;
......
...@@ -293,6 +293,17 @@ and know what setup is needed for it. Or when you want to run ...@@ -293,6 +293,17 @@ and know what setup is needed for it. Or when you want to run
everything up to a certain test. everything up to a certain test.
Running tests with special setups
---------------------------------
The whole test suite could be run to test some special features
that cannot be easily covered by a few specific test cases. These
could be enabled by running the test suite with correct GIT_TEST_
environment set.
GIT_TEST_SPLIT_INDEX=<boolean> forces split-index mode on the whole
test suite. Accept any boolean values that are accepted by git-config.
Naming Tests Naming Tests
------------ ------------
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册