test-lib: allow setting the index format version · programmerq/git@5d9fc88 · GitHub
Skip to content

Commit 5d9fc88

Browse files
tgummerergitster
authored andcommitted
test-lib: allow setting the index format version
Allow adding a TEST_GIT_INDEX_VERSION variable to config.mak to set the index version with which the test suite should be run. If it isn't set, the default version given in the source code is used (currently version 3). To avoid breakages with index versions other than [23], also set the index version under which t2104 is run to 3. This test only tests functionality specific to version 2 and 3 of the index file and would fail if the test suite is run with any other version. Helped-by: Junio C Hamano <gitster@pobox.com> Signed-off-by: Thomas Gummerer <t.gummerer@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
1 parent 136347d commit 5d9fc88

4 files changed

Lines changed: 20 additions & 0 deletions

File tree

Makefile

Lines changed: 7 additions & 0 deletions

t/t2104-update-index-skip-worktree.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ test_description='skip-worktree bit test'
77

88
. ./test-lib.sh
99

10+
test_set_index_version 3
11+
1012
cat >expect.full <<EOF
1113
H 1
1214
H 2

t/test-lib-functions.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,11 @@ test_set_editor () {
3232
export EDITOR
3333
}
3434

35+
test_set_index_version () {
36+
GIT_INDEX_VERSION="$1"
37+
export GIT_INDEX_VERSION
38+
}
39+
3540
test_decode_color () {
3641
awk '
3742
function name(n) {

t/test-lib.sh

Lines changed: 6 additions & 0 deletions

0 commit comments

Comments
 (0)