Skip to content

Commit f909f39

Browse files
derrickstoleedscho
authored andcommitted
t1092: add compatibility tests for 'git show'
Signed-off-by: Derrick Stolee <[email protected]>
1 parent 46e1b4b commit f909f39

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

t/t1092-sparse-checkout-compatibility.sh

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1164,6 +1164,22 @@ test_expect_success 'clean' '
11641164
test_sparse_match test_path_is_dir folder1
11651165
'
11661166

1167+
test_expect_success 'show (cached blobs/trees)' '
1168+
init_repos &&
1169+
1170+
test_all_match git show :a &&
1171+
test_all_match git show :deep/a &&
1172+
test_sparse_match git show :folder1/a &&
1173+
1174+
# Asking "git show" for directories in the index
1175+
# does not work as implemented. The error message is
1176+
# different for a full checkout and a sparse checkout
1177+
# when the directory is outside of the cone.
1178+
test_all_match test_must_fail git show :deep/ &&
1179+
test_must_fail git -C full-checkout show :folder1/ &&
1180+
test_sparse_match test_must_fail git show :folder1/
1181+
'
1182+
11671183
test_expect_success 'submodule handling' '
11681184
init_repos &&
11691185

0 commit comments

Comments
 (0)