[PATCH 19/27] entry: ensure full index
- From
Derrick Stolee via GitGitGadget <gitgitgadget@gmail.com>
- Date
- Mar 16, 2021, 21:17 UTC
- Message-ID
- <6e0b452f44c1b8f8a5f9c0478b05a7d9248f69ad.1615929436.git.gitgitgadget@gmail.com>
- In-Reply-To
- <pull.906.git.1615929435.gitgitgadget@gmail.com>
From: Derrick Stolee <dstolee@microsoft.com>
Before iterating over all cache entries, ensure that a sparse index is expanded to a full index to avoid unexpected behavior.
Signed-off-by: Derrick Stolee <dstolee@microsoft.com> --- entry.c | 1 + 1 file changed, 1 insertion(+)
diff --git a/entry.c b/entry.c index 7b9f43716f76..e55a2af867cf 100644 --- a/entry.c +++ b/entry.c @@ -412,6 +412,7 @@ static void mark_colliding_entries(const struct checkout *state, ce->ce_flags |= CE_MATCHED; + ensure_full_index(state->istate); for (i = 0; i < state->istate->cache_nr; i++) { struct cache_entry *dup = state->istate->cache[i];
-- gitgitgadget