tests: stop assuming --no-cone is the default mode for sparse-checkout

Add an explicit --no-cone to several sparse-checkout invocations in preparation for changing the default to cone mode. Signed-off-by: Elijah Newren <newren@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Elijah Newren committed Apr 22, 2022 at 02:32 UTC dde1358970ab9ddafb9f664baadeddde1e9e7842
6 files changed +17 -16
t/t1091-sparse-checkout-builtin.sh
+8 -7
@@ -72,7 +72,7 @@ test_expect_success 'git sparse-checkout list (populated)' '
72 '
73
74 test_expect_success 'git sparse-checkout init' '
75 - git -C repo sparse-checkout init &&
75 + git -C repo sparse-checkout init --no-cone &&
76 cat >expect <<-\EOF &&
77 /*
78 !/*/
@@ -111,6 +111,7 @@ test_expect_success 'init with existing sparse-checkout' '
111
112 test_expect_success 'clone --sparse' '
113 git clone --sparse "file://$(pwd)/repo" clone &&
114 + git -C clone sparse-checkout reapply --no-cone &&
115 git -C clone sparse-checkout list >actual &&
116 cat >expect <<-\EOF &&
117 /*
@@ -124,7 +125,7 @@ test_expect_success 'switching to cone mode with non-cone mode patterns' '
125 git init bad-patterns &&
126 (
127 cd bad-patterns &&
127 - git sparse-checkout init &&
128 + git sparse-checkout init --no-cone &&
129 git sparse-checkout add dir &&
130 git config --worktree core.sparseCheckoutCone true &&
131 test_must_fail git sparse-checkout add dir 2>err &&
@@ -402,7 +403,7 @@ test_expect_success 'revert to old sparse-checkout on empty update' '
403 git sparse-checkout set nothing 2>err &&
404 test_i18ngrep ! "Sparse checkout leaves no entry on working directory" err &&
405 test_i18ngrep ! ".git/index.lock" err &&
405 - git sparse-checkout set file
406 + git sparse-checkout set --no-cone file
407 )
408 '
409
@@ -424,7 +425,7 @@ test_expect_success 'sparse-checkout (init|set|disable) warns with dirty status'
425 git clone repo dirty &&
426 echo dirty >dirty/folder1/a &&
427
427 - git -C dirty sparse-checkout init 2>err &&
428 + git -C dirty sparse-checkout init --no-cone 2>err &&
429 test_i18ngrep "warning.*The following paths are not up to date" err &&
430
431 git -C dirty sparse-checkout set /folder2/* /deep/deeper1/* 2>err &&
@@ -435,7 +436,7 @@ test_expect_success 'sparse-checkout (init|set|disable) warns with dirty status'
436 test_must_be_empty err &&
437
438 git -C dirty reset --hard &&
438 - git -C dirty sparse-checkout init &&
439 + git -C dirty sparse-checkout init --no-cone &&
440 git -C dirty sparse-checkout set /folder2/* /deep/deeper1/* &&
441 test_path_is_missing dirty/folder1/a &&
442 git -C dirty sparse-checkout disable &&
@@ -451,7 +452,7 @@ test_expect_success 'sparse-checkout (init|set|disable) warns with unmerged stat
452 EOF
453 git -C unmerged update-index --index-info <input &&
454
454 - git -C unmerged sparse-checkout init 2>err &&
455 + git -C unmerged sparse-checkout init --no-cone 2>err &&
456 test_i18ngrep "warning.*The following paths are unmerged" err &&
457
458 git -C unmerged sparse-checkout set /folder2/* /deep/deeper1/* 2>err &&
@@ -462,7 +463,7 @@ test_expect_success 'sparse-checkout (init|set|disable) warns with unmerged stat
463 test_i18ngrep "warning.*The following paths are unmerged" err &&
464
465 git -C unmerged reset --hard &&
465 - git -C unmerged sparse-checkout init &&
466 + git -C unmerged sparse-checkout init --no-cone &&
467 git -C unmerged sparse-checkout set /folder2/* /deep/deeper1/* &&
468 git -C unmerged sparse-checkout disable
469 '
t/t3602-rm-sparse-checkout.sh
+3 -3
@@ -30,7 +30,7 @@ test_expect_success 'setup' "
30 for opt in "" -f --dry-run
31 do
32 test_expect_success "rm${opt:+ $opt} does not remove sparse entries" '
33 - git sparse-checkout set a &&
33 + git sparse-checkout set --no-cone a &&
34 test_must_fail git rm $opt b 2>stderr &&
35 test_cmp b_error_and_hint stderr &&
36 git ls-files --error-unmatch b
@@ -118,7 +118,7 @@ test_expect_success 'can remove files from non-sparse dir' '
118 test_commit w/f &&
119 test_commit x/y/f &&
120
121 - git sparse-checkout set w !/x y/ &&
121 + git sparse-checkout set --no-cone w !/x y/ &&
122 git rm w/f.t x/y/f.t 2>stderr &&
123 test_must_be_empty stderr
124 '
@@ -128,7 +128,7 @@ test_expect_success 'refuse to remove non-skip-worktree file from sparse dir' '
128 git sparse-checkout disable &&
129 mkdir -p x/y/z &&
130 test_commit x/y/z/f &&
131 - git sparse-checkout set !/x y/ !x/y/z &&
131 + git sparse-checkout set --no-cone !/x y/ !x/y/z &&
132
133 git update-index --no-skip-worktree x/y/z/f.t &&
134 test_must_fail git rm x/y/z/f.t 2>stderr &&
t/t3705-add-sparse-checkout.sh
+2 -2
@@ -166,7 +166,7 @@ test_expect_success 'do not warn when pathspec matches dense entries' '
166 test_expect_success 'git add fails outside of sparse-checkout definition' '
167 test_when_finished git sparse-checkout disable &&
168 test_commit a &&
169 - git sparse-checkout init &&
169 + git sparse-checkout init --no-cone &&
170 git sparse-checkout set a &&
171 echo >>sparse_entry &&
172
@@ -208,7 +208,7 @@ test_expect_success 'add obeys advice.updateSparsePath' '
208 '
209
210 test_expect_success 'add allows sparse entries with --sparse' '
211 - git sparse-checkout set a &&
211 + git sparse-checkout set --no-cone a &&
212 echo modified >sparse_entry &&
213 test_must_fail git add sparse_entry &&
214 test_sparse_entry_unchanged &&
t/t6428-merge-conflicts-sparse.sh
+2 -2
@@ -87,7 +87,7 @@ test_expect_success 'conflicting entries written to worktree even if sparse' '
87 test_path_is_file numerals &&
88
89 git sparse-checkout init &&
90 - git sparse-checkout set README &&
90 + git sparse-checkout set --no-cone README &&
91
92 test_path_is_file README &&
93 test_path_is_missing numerals &&
@@ -123,7 +123,7 @@ test_expect_success 'present-despite-SKIP_WORKTREE handled reasonably' '
123 test_path_is_file numerals &&
124
125 git sparse-checkout init &&
126 - git sparse-checkout set README &&
126 + git sparse-checkout set --no-cone README &&
127
128 test_path_is_file README &&
129 test_path_is_missing numerals &&
t/t7002-mv-sparse-checkout.sh
+1 -1
@@ -27,7 +27,7 @@ test_expect_success 'setup' "
27 test_expect_success 'mv refuses to move sparse-to-sparse' '
28 test_when_finished rm -f e &&
29 git reset --hard &&
30 - git sparse-checkout set a &&
30 + git sparse-checkout set --no-cone a &&
31 touch b &&
32 test_must_fail git mv b e 2>stderr &&
33 cat sparse_error_header >expect &&
t/t7012-skip-worktree-writing.sh
+1 -1
@@ -151,7 +151,7 @@ test_expect_success 'stash restore in sparse checkout' '
151
152 git stash push &&
153
154 - git sparse-checkout set subdir &&
154 + git sparse-checkout set --no-cone subdir &&
155
156 # Ensure after sparse-checkout we only have expected files
157 cat >expect <<-EOF &&