Skip to content

Commit 86609db

Browse files
vdyegitster
authored andcommitted
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 <[email protected]> Signed-off-by: Victoria Dye <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 71471b2 commit 86609db

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

t/t1092-sparse-checkout-compatibility.sh

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -634,11 +634,15 @@ test_expect_success 'submodule handling' '
634634
grep "160000 commit $(git -C initial-repo rev-parse HEAD) modules/sub" cache
635635
'
636636

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.
637641
test_expect_success 'sparse-index is expanded and converted back' '
638642
init_repos &&
639643
640644
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 &&
642646
test_region index convert_to_sparse trace2.txt &&
643647
test_region index ensure_full_index trace2.txt
644648
'

0 commit comments

Comments
 (0)