diff options
author | Derrick Stolee <dstolee@microsoft.com> | 2020-01-31 23:16:15 +0300 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2020-02-01 00:05:29 +0300 |
commit | f998a3f1e588d73ed7285cb14ac4839f63f6dc82 (patch) | |
tree | 264439faaceedd68588b444cd191b450fbd1e700 /unpack-trees.c | |
parent | d2e65f4c9056be72ff8a1f39245c5e1b27d556b2 (diff) |
sparse-checkout: fix cone mode behavior mismatch
The intention of the special "cone mode" in the sparse-checkout
feature is to always match the same patterns that are matched by the
same sparse-checkout file as when cone mode is disabled.
When a file path is given to "git sparse-checkout set" in cone mode,
then the cone mode improperly matches the file as a recursive path.
When setting the skip-worktree bits, files were not expecting the
MATCHED_RECURSIVE response, and hence these were left out of the
matched cone.
Fix this bug by checking for MATCHED_RECURSIVE in addition to MATCHED
and add a test that prevents regression.
Reported-by: Finn Bryant <finnbryant@gmail.com>
Signed-off-by: Derrick Stolee <dstolee@microsoft.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'unpack-trees.c')
-rw-r--r-- | unpack-trees.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/unpack-trees.c b/unpack-trees.c index 3789a22cf0..78425ce74b 100644 --- a/unpack-trees.c +++ b/unpack-trees.c @@ -1416,7 +1416,7 @@ static int clear_ce_flags_1(struct index_state *istate, name, &dtype, pl, istate); if (ret == UNDECIDED) ret = default_match; - if (ret == MATCHED) + if (ret == MATCHED || ret == MATCHED_RECURSIVE) ce->ce_flags &= ~clear_mask; cache++; progress_nr++; |