t1092: add tests for `git diff-files`
commit0aba1a989c7c577dc1b0b096a12615b7a6747c54
authorShuqi Liang <cheskaqiqi@gmail.com>
Tue, 9 May 2023 19:42:40 +0000 (9 15:42 -0400)
committerJunio C Hamano <gitster@pobox.com>
Tue, 9 May 2023 21:26:34 +0000 (9 14:26 -0700)
treeef2e75797fa80aa9b71f1dadcd001bcd685e3cdc
parent7580f92ffa970b9484ac214f7b53cec5e26ca4bc
t1092: add tests for `git diff-files`

Before integrating the 'git diff-files' builtin with the sparse index
feature, add tests to t1092-sparse-checkout-compatibility.sh to ensure
it currently works with sparse-checkout and will still work with sparse
index after that integration.

When adding tests against a sparse-checkout definition, we test two
modes: all changes are within the sparse-checkout cone and some changes
are outside the sparse-checkout cone.

In order to have staged changes outside of the sparse-checkout cone,
make a directory called 'folder1' and copy `a` into 'folder1/a'.
'folder1/a' is identical to `a` in the base commit. These make
'folder1/a' in the index, while leaving it outside of the
sparse-checkout definition. Change content inside 'folder1/a' in order
to test 'folder1/a' being present on-disk with modifications.

Signed-off-by: Shuqi Liang <cheskaqiqi@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
t/t1092-sparse-checkout-compatibility.sh