Skip to content

Commit ac873c2

Browse files
dschogitster
authored andcommitted
t1091: disable split index
In 61feddc (tests: disable GIT_TEST_SPLIT_INDEX for sparse index tests, 2021-08-26), it was already called out that the split index feature is incompatible with the sparse index feature, and its commit message wondered aloud whether more checks would be required to ensure that the split index and sparse index features aren't enabled at the same time. We are about to introduce such additional checks, and indeed, t1091 would utterly fail with them. Therefore, let's preemptively disable the split index for the entirety of t1091. This partially reverts above-mentioned patch because it covered only one test case whereas we want to cover the entire test script. Signed-off-by: Johannes Schindelin <[email protected]> Reviewed-by: Elijah Newren <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent ae103c3 commit ac873c2

File tree

1 file changed

+26
-28
lines changed

1 file changed

+26
-28
lines changed

t/t1091-sparse-checkout-builtin.sh

Lines changed: 26 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@ test_description='sparse checkout builtin tests'
55
GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
66
export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
77

8+
GIT_TEST_SPLIT_INDEX=false
9+
export GIT_TEST_SPLIT_INDEX
10+
811
. ./test-lib.sh
912

1013
list_files() {
@@ -228,36 +231,31 @@ test_expect_success 'sparse-checkout disable' '
228231
'
229232

230233
test_expect_success 'sparse-index enabled and disabled' '
231-
(
232-
sane_unset GIT_TEST_SPLIT_INDEX &&
233-
git -C repo update-index --no-split-index &&
234-
235-
git -C repo sparse-checkout init --cone --sparse-index &&
236-
test_cmp_config -C repo true index.sparse &&
237-
git -C repo ls-files --sparse >sparse &&
238-
git -C repo sparse-checkout disable &&
239-
git -C repo ls-files --sparse >full &&
240-
241-
cat >expect <<-\EOF &&
242-
@@ -1,4 +1,7 @@
243-
a
244-
-deep/
245-
-folder1/
246-
-folder2/
247-
+deep/a
248-
+deep/deeper1/a
249-
+deep/deeper1/deepest/a
250-
+deep/deeper2/a
251-
+folder1/a
252-
+folder2/a
253-
EOF
234+
git -C repo sparse-checkout init --cone --sparse-index &&
235+
test_cmp_config -C repo true index.sparse &&
236+
git -C repo ls-files --sparse >sparse &&
237+
git -C repo sparse-checkout disable &&
238+
git -C repo ls-files --sparse >full &&
254239
255-
diff -u sparse full | tail -n +3 >actual &&
256-
test_cmp expect actual &&
240+
cat >expect <<-\EOF &&
241+
@@ -1,4 +1,7 @@
242+
a
243+
-deep/
244+
-folder1/
245+
-folder2/
246+
+deep/a
247+
+deep/deeper1/a
248+
+deep/deeper1/deepest/a
249+
+deep/deeper2/a
250+
+folder1/a
251+
+folder2/a
252+
EOF
253+
254+
diff -u sparse full | tail -n +3 >actual &&
255+
test_cmp expect actual &&
257256
258-
git -C repo config --list >config &&
259-
! grep index.sparse config
260-
)
257+
git -C repo config --list >config &&
258+
! grep index.sparse config
261259
'
262260

263261
test_expect_success 'cone mode: init and set' '

0 commit comments

Comments
 (0)