tests: make test_must_fail more verbose
[gitweb.git] / t / t1011-read-tree-sparse-checkout.sh
index 9189de8461825bec601760415fa6e5a9c8fc14c1..9a07de1a5b6d3a98c0db0b24cdd9c3a68cef79b5 100755 (executable)
@@ -155,4 +155,25 @@ test_expect_success 'read-tree adds to worktree, dirty case' '
        grep -q dirty sub/added
 '
 
+test_expect_success 'index removal and worktree narrowing at the same time' '
+       >empty &&
+       echo init.t >.git/info/sparse-checkout &&
+       echo sub/added >>.git/info/sparse-checkout &&
+       git checkout -f top &&
+       echo init.t >.git/info/sparse-checkout &&
+       git checkout removed &&
+       git ls-files sub/added >result &&
+       test ! -f sub/added &&
+       test_cmp empty result
+'
+
+test_expect_success 'read-tree --reset removes outside worktree' '
+       >empty &&
+       echo init.t >.git/info/sparse-checkout &&
+       git checkout -f top &&
+       git reset --hard removed &&
+       git ls-files sub/added >result &&
+       test_cmp empty result
+'
+
 test_done