diff options
| author | Junio C Hamano <gitster@pobox.com> | 2025-09-08 14:54:34 -0700 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2025-09-08 14:54:35 -0700 |
| commit | 576e0b6eb34f8989f07ae77db10baf1c75125c47 (patch) | |
| tree | c2962bfd758f54f9c54ca6c032080d19c7d9ce54 /t | |
| parent | Merge branch 'ds/path-walk-repack-fix' (diff) | |
| parent | ls-files: conditionally leave index sparse (diff) | |
| download | git-576e0b6eb34f8989f07ae77db10baf1c75125c47.tar.gz git-576e0b6eb34f8989f07ae77db10baf1c75125c47.zip | |
Merge branch 'ds/ls-files-lazy-unsparse'
"git ls-files <pathspec>..." should not necessarily have to expand
the index fully if a sparsified directory is excluded by the
pathspec; the code is taught to expand the index on demand to avoid
this.
* ds/ls-files-lazy-unsparse:
ls-files: conditionally leave index sparse
Diffstat (limited to 't')
| -rwxr-xr-x | t/t1092-sparse-checkout-compatibility.sh | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/t/t1092-sparse-checkout-compatibility.sh b/t/t1092-sparse-checkout-compatibility.sh index d8101139b4..b0f691c151 100755 --- a/t/t1092-sparse-checkout-compatibility.sh +++ b/t/t1092-sparse-checkout-compatibility.sh @@ -1506,6 +1506,8 @@ test_expect_success 'sparse-index is not expanded' ' ensure_not_expanded reset --hard && ensure_not_expanded restore -s rename-out-to-out -- deep/deeper1 && + ensure_not_expanded ls-files deep/deeper1 && + echo >>sparse-index/README.md && ensure_not_expanded add -A && echo >>sparse-index/extra.txt && @@ -1607,6 +1609,17 @@ test_expect_success 'describe tested on all' ' test_all_match git describe --dirty ' +test_expect_success 'ls-files filtering and expansion' ' + init_repos && + + # This filtering will hit a sparse directory midway + # through the iteration. + test_all_match git ls-files deep && + + # This pathspec will filter the index to only a sparse + # directory. + test_all_match git ls-files folder1 +' test_expect_success 'sparse-index is not expanded: describe' ' init_repos && |
