5
GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
6
export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
7
8
+GIT_TEST_SPLIT_INDEX=false
9
+export GIT_TEST_SPLIT_INDEX
10
+
11
. ./test-lib.sh
12
13
list_files() {
231
'
232
233
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 &&
239
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 &&
256
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
259
'
260
261
test_expect_success 'cone mode: init and set' '