]> git.ipfire.org Git - thirdparty/git.git/blobdiff - t/t1092-sparse-checkout-compatibility.sh
wt-status: expand added sparse directory entries
[thirdparty/git.git] / t / t1092-sparse-checkout-compatibility.sh
index 751f397cc7f46e395beceedac037ef6f341211c3..2394c36d881106f410df28bca6c2ce0cd65b6bb1 100755 (executable)
@@ -524,4 +524,37 @@ test_expect_success 'sparse-index is not expanded' '
        test_region ! index ensure_full_index trace2.txt
 '
 
+test_expect_success 'reset mixed and checkout orphan' '
+       init_repos &&
+
+       test_all_match git checkout rename-out-to-in &&
+
+       # Sparse checkouts do not agree with full checkouts about
+       # how to report a directory/file conflict during a reset.
+       # This command would fail with test_all_match because the
+       # full checkout reports "T folder1/0/1" while a sparse
+       # checkout reports "D folder1/0/1". This matches because
+       # 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 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 status --porcelain=v2
+'
+
+test_expect_success 'add everything with deep new file' '
+       init_repos &&
+
+       run_on_sparse git sparse-checkout set deep/deeper1/deepest &&
+
+       run_on_all touch deep/deeper1/x &&
+       test_all_match git add . &&
+       test_all_match git status --porcelain=v2
+'
+
 test_done