Skip to content

Commit 8c4c2ad

Browse files
committed
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 <dstolee@microsoft.com>
1 parent 5af4986 commit 8c4c2ad

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

dir.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1527,6 +1527,13 @@ static int path_in_sparse_checkout_1(const char *path,
15271527
enum pattern_match_result match = UNDECIDED;
15281528
const char *end, *slash;
15291529

1530+
/*
1531+
* When using a virtual filesystem, there aren't really patterns
1532+
* to follow, but be extra careful to skip this check.
1533+
*/
1534+
if (core_virtualfilesystem)
1535+
return 1;
1536+
15301537
/*
15311538
* We default to accepting a path if the path is empty, there are no
15321539
* patterns, or the patterns are of the wrong type.

t/t1092-sparse-checkout-compatibility.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1007,7 +1007,9 @@ test_expect_success 'read-tree --merge with directory-file conflicts' '
10071007
test_expect_success 'merge, cherry-pick, and rebase' '
10081008
init_repos &&
10091009
1010-
for OPERATION in "merge -m merge" cherry-pick "rebase --apply" "rebase --merge"
1010+
# microsoft/git specific: we need to use "quiet" mode
1011+
# to avoid different stderr for some rebases.
1012+
for OPERATION in "merge -m merge" cherry-pick "rebase -q --apply" "rebase -q --merge"
10111013
do
10121014
test_all_match git checkout -B temp update-deep &&
10131015
test_all_match git $OPERATION update-folder1 &&

0 commit comments

Comments
 (0)