@@ -200,45 +200,42 @@ test_sparse_unstaged () {
test_expect_success 'sparse-index contents' '
init_repos &&
- test-tool -C sparse-index read-cache --table >cache &&
+ git -C sparse-index ls-files --sparse --stage >cache &&
for dir in folder1 folder2 x
do
TREE=$(git -C sparse-index rev-parse HEAD:$dir) &&
- grep "040000 tree $TREE $dir/" cache \
+ grep "040000 $TREE 0 $dir/" cache \
|| return 1
done &&
git -C sparse-index sparse-checkout set folder1 &&
- test-tool -C sparse-index read-cache --table >cache &&
+ git -C sparse-index ls-files --sparse --stage >cache &&
for dir in deep folder2 x
do
TREE=$(git -C sparse-index rev-parse HEAD:$dir) &&
- grep "040000 tree $TREE $dir/" cache \
+ grep "040000 $TREE 0 $dir/" cache \
|| return 1
done &&
git -C sparse-index sparse-checkout set deep/deeper1 &&
- test-tool -C sparse-index read-cache --table >cache &&
+ git -C sparse-index ls-files --sparse --stage >cache &&
for dir in deep/deeper2 folder1 folder2 x
do
TREE=$(git -C sparse-index rev-parse HEAD:$dir) &&
- grep "040000 tree $TREE $dir/" cache \
+ grep "040000 $TREE 0 $dir/" cache \
|| return 1
done &&
- # Disabling the sparse-index removes tree entries with full ones
+ # Disabling the sparse-index replaces tree entries with full ones
git -C sparse-index sparse-checkout init --no-sparse-index &&
-
- test-tool -C sparse-index read-cache --table >cache &&
- ! grep "040000 tree" cache &&
- test_sparse_match test-tool read-cache --table
+ test_sparse_match git ls-files --stage --sparse
'
test_expect_success 'expanded in-memory index matches full index' '
init_repos &&
- test_sparse_match test-tool read-cache --expand --table
+ test_sparse_match git ls-files --stage
'
test_expect_success 'status with options' '
@@ -787,9 +784,9 @@ test_expect_success 'submodule handling' '
# having a submodule prevents "modules" from collapse
test_sparse_match git sparse-checkout set deep/deeper1 &&
- test-tool -C sparse-index read-cache --table >cache &&
- grep "100644 blob .* modules/a" cache &&
- grep "160000 commit $(git -C initial-repo rev-parse HEAD) modules/sub" cache
+ git -C sparse-index ls-files --sparse --stage >cache &&
+ grep "100644 .* modules/a" cache &&
+ grep "160000 $(git -C initial-repo rev-parse HEAD) 0 modules/sub" cache
'
# When working with a sparse index, some commands will need to expand the
@@ -1085,13 +1082,13 @@ test_expect_success 'reset mixed and checkout orphan' '
# the sparse checkouts skip "adding" the other side of
# the conflict.
test_sparse_match git reset --mixed HEAD~1 &&
- test_sparse_match test-tool read-cache --table --expand &&
+ test_sparse_match git ls-files --stage &&
test_sparse_match git status --porcelain=v2 &&
# At this point, sparse-checkouts behave differently
# from the full-checkout.
test_sparse_match git checkout --orphan new-branch &&
- test_sparse_match test-tool read-cache --table --expand &&
+ test_sparse_match git ls-files --stage &&
test_sparse_match git status --porcelain=v2
'