sparse-index: update command for expand/collapse test

In anticipation of `git reset --hard` being able to use the sparse index without expanding it, replace the command in `sparse-index is expanded and converted back` with `git reset -- folder1/a`. This command will need to expand the index to work properly, even after integrating the rest of `reset` with sparse index. Helped-by: Derrick Stolee <dstolee@microsoft.com> Signed-off-by: Victoria Dye <vdye@github.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Victoria Dye committed Oct 27, 2021 at 14:39 UTC 86609db9dae77a385ea8c156ac4ca55f8454a3f7
1 file changed +5 -1
t/t1092-sparse-checkout-compatibility.sh
+5 -1
@@ -634,11 +634,15 @@ test_expect_success 'submodule handling' '
634 grep "160000 commit $(git -C initial-repo rev-parse HEAD) modules/sub" cache
635 '
636
637 +# When working with a sparse index, some commands will need to expand the
638 +# index to operate properly. If those commands also write the index back
639 +# to disk, they need to convert the index to sparse before writing.
640 +# This test verifies that both of these events are logged in trace2 logs.
641 test_expect_success 'sparse-index is expanded and converted back' '
642 init_repos &&
643
644 GIT_TRACE2_EVENT="$(pwd)/trace2.txt" GIT_TRACE2_EVENT_NESTING=10 \
641 - git -C sparse-index -c core.fsmonitor="" reset --hard &&
645 + git -C sparse-index reset -- folder1/a &&
646 test_region index convert_to_sparse trace2.txt &&
647 test_region index ensure_full_index trace2.txt
648 '