Skip to content

Commit 528521c

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 <dstolee@microsoft.com>
1 parent 4198780 commit 528521c

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

Diff for: dir.c

+7
Original file line numberDiff line numberDiff line change
@@ -1583,6 +1583,13 @@ static int path_in_sparse_checkout_1(const char *path,
15831583
enum pattern_match_result match = UNDECIDED;
15841584
const char *end, *slash;
15851585

1586+
/*
1587+
* When using a virtual filesystem, there aren't really patterns
1588+
* to follow, but be extra careful to skip this check.
1589+
*/
1590+
if (core_virtualfilesystem)
1591+
return 1;
1592+
15861593
/*
15871594
* We default to accepting a path if the path is empty, there are no
15881595
* patterns, or the patterns are of the wrong type.

Diff for: t/t1092-sparse-checkout-compatibility.sh

+3-1
Original file line numberDiff line numberDiff line change
@@ -1060,7 +1060,9 @@ test_expect_success 'read-tree --merge with directory-file conflicts' '
10601060
test_expect_success 'merge, cherry-pick, and rebase' '
10611061
init_repos &&
10621062
1063-
for OPERATION in "merge -m merge" cherry-pick "rebase --apply" "rebase --merge"
1063+
# microsoft/git specific: we need to use "quiet" mode
1064+
# to avoid different stderr for some rebases.
1065+
for OPERATION in "merge -m merge" cherry-pick "rebase -q --apply" "rebase -q --merge"
10641066
do
10651067
test_all_match git checkout -B temp update-deep &&
10661068
test_all_match git $OPERATION update-folder1 &&

0 commit comments

Comments
 (0)