Skip to content

Commit bb01b26

Browse files
vdyegitster
authored andcommitted
reset: fix validation in sparse index test
Update t1092 test 'reset with pathspecs outside sparse definition' to verify index contents. The use of `rev-parse` verifies the contents of HEAD, not the index, providing no real validation of the reset results. Conversely, `ls-files` reports the contents of the index (OIDs, flags, filenames), which are then compared across checkouts to ensure compatible index states. Fixes 741a2c9 (reset: expand test coverage for sparse checkouts, 2021-09-27). Signed-off-by: Victoria Dye <[email protected]> Reviewed-by: Elijah Newren <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent dcc0cd0 commit bb01b26

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

t/t1092-sparse-checkout-compatibility.sh

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -596,13 +596,11 @@ test_expect_success 'reset with pathspecs outside sparse definition' '
596596
597597
test_sparse_match git reset update-folder1 -- folder1 &&
598598
git -C full-checkout reset update-folder1 -- folder1 &&
599-
test_sparse_match git status --porcelain=v2 &&
600-
test_all_match git rev-parse HEAD:folder1 &&
599+
test_all_match git ls-files -s -- folder1 &&
601600
602601
test_sparse_match git reset update-folder2 -- folder2/a &&
603602
git -C full-checkout reset update-folder2 -- folder2/a &&
604-
test_sparse_match git status --porcelain=v2 &&
605-
test_all_match git rev-parse HEAD:folder2/a
603+
test_all_match git ls-files -s -- folder2/a
606604
'
607605

608606
test_expect_success 'reset with wildcard pathspec' '

0 commit comments

Comments
 (0)