Skip to content

Commit c3a9cec

Browse files
vdyederrickstolee
authored andcommitted
t1092: add sparse directory before cone in test repo
Add a sparse directory 'before/' containing files 'a' and 'b' to the test repo used in 't/t1092-sparse-checkout-compatibility.sh'. This is meant to ensure that no sparse index integrations rely on the in-cone path(s) being lexicographically first in the repo. Unfortunately, some existing tests do not handle this repo architecture properly: * 'add outside sparse cone' * 'status/add: outside sparse cone' * 'reset with pathspecs inside sparse definition' All three of these are due to the incorrect handling of the 'unpack_trees_options.cache_bottom' when performing a cache diff via 'unpack_trees'. This will be corrected in a future patch; in the meantime, mark the tests with 'test_expect_failure'. Finally, update the 'ls-files' and 'root directory cannot be sparse' tests to include the 'before/' directory in their expected index contents. Co-authored-by: Derrick Stolee <[email protected]> Signed-off-by: Victoria Dye <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 74cc1aa commit c3a9cec

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

t/t1092-sparse-checkout-compatibility.sh

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,9 @@ test_expect_success 'setup' '
1616
echo "after deep" >e &&
1717
echo "after folder1" >g &&
1818
echo "after x" >z &&
19-
mkdir folder1 folder2 deep x &&
19+
mkdir folder1 folder2 deep before x &&
20+
echo "before deep" >before/a &&
21+
echo "before deep again" >before/b &&
2022
mkdir deep/deeper1 deep/deeper2 deep/before deep/later &&
2123
mkdir deep/deeper1/deepest &&
2224
mkdir deep/deeper1/deepest2 &&
@@ -254,6 +256,7 @@ test_expect_success 'root directory cannot be sparse' '
254256
255257
# Verify sparse directories still present, root directory is not sparse
256258
cat >expect <<-EOF &&
259+
before/
257260
folder1/
258261
folder2/
259262
x/
@@ -337,7 +340,7 @@ test_expect_success 'deep changes during checkout' '
337340
test_all_match git checkout base
338341
'
339342

340-
test_expect_success 'add outside sparse cone' '
343+
test_expect_failure 'add outside sparse cone' '
341344
init_repos &&
342345
343346
run_on_sparse mkdir folder1 &&
@@ -379,7 +382,7 @@ test_expect_success 'commit including unstaged changes' '
379382
test_all_match git status --porcelain=v2
380383
'
381384

382-
test_expect_success 'status/add: outside sparse cone' '
385+
test_expect_failure 'status/add: outside sparse cone' '
383386
init_repos &&
384387
385388
# folder1 is at HEAD, but outside the sparse cone
@@ -590,7 +593,7 @@ test_expect_success 'checkout and reset (keep)' '
590593
test_all_match test_must_fail git reset --keep deepest
591594
'
592595

593-
test_expect_success 'reset with pathspecs inside sparse definition' '
596+
test_expect_failure 'reset with pathspecs inside sparse definition' '
594597
init_repos &&
595598
596599
write_script edit-contents <<-\EOF &&
@@ -1444,6 +1447,7 @@ test_expect_success 'ls-files' '
14441447
14451448
cat >expect <<-\EOF &&
14461449
a
1450+
before/
14471451
deep/
14481452
e
14491453
folder1-
@@ -1491,6 +1495,7 @@ test_expect_success 'ls-files' '
14911495
14921496
cat >expect <<-\EOF &&
14931497
a
1498+
before/
14941499
deep/
14951500
e
14961501
folder1-

0 commit comments

Comments
 (0)