Skip to content

Commit 1f357b0

Browse files
benpeartgitster
authored andcommitted
read-cache: update TEST_GIT_INDEX_VERSION support
Rename TEST_GIT_INDEX_VERSION to GIT_TEST_INDEX_VERSION 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 4cb54d0 commit 1f357b0

File tree

3 files changed

+15
-9
lines changed

3 files changed

+15
-9
lines changed

Makefile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -400,7 +400,7 @@ all::
400400
# (defaults to "man") if you want to have a different default when
401401
# "git help" is called without a parameter specifying the format.
402402
#
403-
# Define TEST_GIT_INDEX_VERSION to 2, 3 or 4 to run the test suite
403+
# Define GIT_TEST_INDEX_VERSION to 2, 3 or 4 to run the test suite
404404
# with a different indexfile format version. If it isn't set the index
405405
# file format used is index-v[23].
406406
#
@@ -2599,8 +2599,8 @@ endif
25992599
ifdef GIT_INTEROP_MAKE_OPTS
26002600
@echo GIT_INTEROP_MAKE_OPTS=\''$(subst ','\'',$(subst ','\'',$(GIT_INTEROP_MAKE_OPTS)))'\' >>$@+
26012601
endif
2602-
ifdef TEST_GIT_INDEX_VERSION
2603-
@echo TEST_GIT_INDEX_VERSION=\''$(subst ','\'',$(subst ','\'',$(TEST_GIT_INDEX_VERSION)))'\' >>$@+
2602+
ifdef GIT_TEST_INDEX_VERSION
2603+
@echo GIT_TEST_INDEX_VERSION=\''$(subst ','\'',$(subst ','\'',$(GIT_TEST_INDEX_VERSION)))'\' >>$@+
26042604
endif
26052605
@if cmp $@+ $@ >/dev/null 2>&1; then $(RM) $@+; else mv $@+ $@; fi
26062606

t/README

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -323,6 +323,10 @@ GIT_TEST_FSMONITOR=$PWD/t7519/fsmonitor-all exercises the fsmonitor
323323
code path for utilizing a file system monitor to speed up detecting
324324
new or changed files.
325325

326+
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+
326330
Naming Tests
327331
------------
328332

t/test-lib.sh

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -134,12 +134,6 @@ export EDITOR
134134
GIT_TRACE_BARE=1
135135
export GIT_TRACE_BARE
136136

137-
if test -n "${TEST_GIT_INDEX_VERSION:+isset}"
138-
then
139-
GIT_INDEX_VERSION="$TEST_GIT_INDEX_VERSION"
140-
export GIT_INDEX_VERSION
141-
fi
142-
143137
check_var_migration () {
144138
old_name=$1 new_name=$2
145139
eval "old_isset=\${${old_name}:+isset}"
@@ -159,6 +153,14 @@ check_var_migration () {
159153
}
160154

161155
check_var_migration GIT_FSMONITOR_TEST GIT_TEST_FSMONITOR
156+
check_var_migration TEST_GIT_INDEX_VERSION GIT_TEST_INDEX_VERSION
157+
158+
# Use specific version of the index file format
159+
if test -n "${GIT_TEST_INDEX_VERSION:+isset}"
160+
then
161+
GIT_INDEX_VERSION="$GIT_TEST_INDEX_VERSION"
162+
export GIT_INDEX_VERSION
163+
fi
162164

163165
# Add libc MALLOC and MALLOC_PERTURB test
164166
# only if we are not executing the test with valgrind

0 commit comments

Comments
 (0)