Changes since v7: * Refactor the ensure_expanded and ensure_not_expanded functions by introducing a helper function, ensure_index_state. * Delete the test 'diff-files pathspec expands index when necessary'. * Delete 'the pathspec_needs_expanded_index' function. * Add double quotes to "deep/*" * Change "**a" to "*a" * Updata commit message. Shuqi Liang (2): t1092: add tests for `git diff-files` diff-files: integrate with sparse index builtin/diff-files.c | 4 ++ t/perf/p2000-sparse-operations.sh | 2 + t/t1092-sparse-checkout-compatibility.sh | 81 +++++++++++++++++++++++- 3 files changed, 85 insertions(+), 2 deletions(-) Range-diff: 1: e2dcf9921e ! 1: d7f921c1a6 t1092: add tests for `git diff-files` @@ Commit message Signed-off-by: Shuqi Liang <cheskaqiqi@xxxxxxxxx> ## t/t1092-sparse-checkout-compatibility.sh ## -@@ t/t1092-sparse-checkout-compatibility.sh: test_expect_success 'grep sparse directory within submodules' ' - test_cmp actual expect +@@ t/t1092-sparse-checkout-compatibility.sh: test_expect_success 'sparse-index is not expanded: write-tree' ' + ensure_not_expanded write-tree ' +test_expect_success 'diff-files with pathspec inside sparse definition' ' @@ t/t1092-sparse-checkout-compatibility.sh: test_expect_success 'grep sparse direc + test_all_match git diff-files deep/a && + + # test wildcard -+ test_all_match git diff-files deep/* ++ test_all_match git diff-files "deep/*" +' + +test_expect_success 'diff-files with pathspec outside sparse definition' ' 2: fb8edaf583 < -: ---------- diff-files: integrate with sparse index -: ---------- > 2: b44384ac94 diff-files: integrate with sparse index -- 2.39.0