Skip to content

Commit 6aa88a3

Browse files
derrickstoleedscho
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 <[email protected]>
1 parent 5f14a90 commit 6aa88a3

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
@@ -1588,6 +1588,13 @@ static int path_in_sparse_checkout_1(const char *path,
15881588
enum pattern_match_result match = UNDECIDED;
15891589
const char *end, *slash;
15901590

1591+
/*
1592+
* When using a virtual filesystem, there aren't really patterns
1593+
* to follow, but be extra careful to skip this check.
1594+
*/
1595+
if (core_virtualfilesystem)
1596+
return 1;
1597+
15911598
/*
15921599
* We default to accepting a path if the path is empty, there are no
15931600
* 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
@@ -1098,7 +1098,9 @@ test_expect_success 'read-tree --merge with directory-file conflicts' '
10981098
test_expect_success 'merge, cherry-pick, and rebase' '
10991099
init_repos &&
11001100
1101-
for OPERATION in "merge -m merge" cherry-pick "rebase --apply" "rebase --merge"
1101+
# microsoft/git specific: we need to use "quiet" mode
1102+
# to avoid different stderr for some rebases.
1103+
for OPERATION in "merge -m merge" cherry-pick "rebase -q --apply" "rebase -q --merge"
11021104
do
11031105
test_all_match git checkout -B temp update-deep &&
11041106
test_all_match git $OPERATION update-folder1 &&

0 commit comments

Comments
 (0)