From 322aa50518762554c7005a18393729a0732dcb2c Mon Sep 17 00:00:00 2001 From: Derrick Stolee Date: Sat, 30 Oct 2021 20:41:32 -0400 Subject: [PATCH] sparse: add vfs-specific precautions * t1092: remove the 'git update-index' test that currently fails because the command ignores the bad path, but doesn't return a failure. * dir.c: prevent matching against sparse-checkout patterns when the virtual filesystem is enabled. Should prevent some corner case issues. * t1092: add quiet mode for some rebase tests because the stderr output can change in some of the modes. Signed-off-by: Derrick Stolee --- dir.c | 7 +++++++ t/t1092-sparse-checkout-compatibility.sh | 4 +++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/dir.c b/dir.c index edf15baaeffd46..b94a8a1b0c4d3a 100644 --- a/dir.c +++ b/dir.c @@ -1525,6 +1525,13 @@ static int path_in_sparse_checkout_1(const char *path, enum pattern_match_result match = UNDECIDED; const char *end, *slash; + /* + * When using a virtual filesystem, there aren't really patterns + * to follow, but be extra careful to skip this check. + */ + if (core_virtualfilesystem) + return 1; + /* * We default to accepting a path if the path is empty, there are no * patterns, or the patterns are of the wrong type. diff --git a/t/t1092-sparse-checkout-compatibility.sh b/t/t1092-sparse-checkout-compatibility.sh index 5f7e67d4f941f5..038d3f6cc6e005 100755 --- a/t/t1092-sparse-checkout-compatibility.sh +++ b/t/t1092-sparse-checkout-compatibility.sh @@ -1016,7 +1016,9 @@ test_expect_success 'read-tree --merge with directory-file conflicts' ' test_expect_success 'merge, cherry-pick, and rebase' ' init_repos && - for OPERATION in "merge -m merge" cherry-pick "rebase --apply" "rebase --merge" + # microsoft/git specific: we need to use "quiet" mode + # to avoid different stderr for some rebases. + for OPERATION in "merge -m merge" cherry-pick "rebase -q --apply" "rebase -q --merge" do test_all_match git checkout -B temp update-deep && test_all_match git $OPERATION update-folder1 &&