Skip to content

Commit 5ef1fba

Browse files
derrickstoleevdye
authored andcommitted
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 d6a8d13 commit 5ef1fba

2 files changed

Lines changed: 10 additions & 1 deletion

File tree

dir.c

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

1534+
/*
1535+
* When using a virtual filesystem, there aren't really patterns
1536+
* to follow, but be extra careful to skip this check.
1537+
*/
1538+
if (core_virtualfilesystem)
1539+
return 1;
1540+
15341541
/*
15351542
* We default to accepting a path if the path is empty, there are no
15361543
* 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
@@ -1029,7 +1029,9 @@ test_expect_success 'read-tree --merge with directory-file conflicts' '
10291029
test_expect_success 'merge, cherry-pick, and rebase' '
10301030
init_repos &&
10311031
1032-
for OPERATION in "merge -m merge" cherry-pick "rebase --apply" "rebase --merge"
1032+
# microsoft/git specific: we need to use "quiet" mode
1033+
# to avoid different stderr for some rebases.
1034+
for OPERATION in "merge -m merge" cherry-pick "rebase -q --apply" "rebase -q --merge"
10331035
do
10341036
test_all_match git checkout -B temp update-deep &&
10351037
test_all_match git $OPERATION update-folder1 &&

0 commit comments

Comments
 (0)