@@ -488,13 +488,14 @@ test_expect_success 'blame with pathspec inside sparse definition' '
488
488
489
489
# TODO: blame currently does not support blaming files outside of the
490
490
# sparse definition. It complains that the file doesn't exist locally.
491
- test_expect_failure ' blame with pathspec outside sparse definition' '
491
+ test_expect_success ' blame with pathspec outside sparse definition' '
492
492
init_repos &&
493
493
494
- test_all_match git blame folder1/a &&
495
- test_all_match git blame folder2/a &&
496
- test_all_match git blame deep/deeper2/a &&
497
- test_all_match git blame deep/deeper2/deepest/a
494
+ test_sparse_match git sparse-checkout set &&
495
+ test_sparse_match test_must_fail git blame folder1/a &&
496
+ test_sparse_match test_must_fail git blame folder2/a &&
497
+ test_sparse_match test_must_fail git blame deep/deeper2/a &&
498
+ test_sparse_match test_must_fail git blame deep/deeper2/deepest/a
498
499
'
499
500
500
501
# TODO: This behaves correctly in microsoft/git. Why?
@@ -1322,6 +1323,15 @@ test_expect_success 'stash -u outside sparse checkout definition' '
1322
1323
test_all_match git status --porcelain=v2
1323
1324
'
1324
1325
1326
+ test_expect_success ' sparse index is not expanded: blame' '
1327
+ init_repos &&
1328
+
1329
+ ensure_not_expanded blame a &&
1330
+ ensure_not_expanded blame deep/a &&
1331
+ ensure_not_expanded blame deep/deeper1/a &&
1332
+ ensure_not_expanded blame deep/deeper1/deepest/a
1333
+ '
1334
+
1325
1335
# NEEDSWORK: a sparse-checkout behaves differently from a full checkout
1326
1336
# in this scenario, but it shouldn't.
1327
1337
test_expect_success ' reset mixed and checkout orphan' '
0 commit comments