From: Derrick Stolee via GitGitGadget Date: Tue, 16 Mar 2021 21:17:07 GMT Subject: [PATCH 19/27] entry: ensure full index Message-ID: <6e0b452f44c1b8f8a5f9c0478b05a7d9248f69ad.1615929436.git.gitgitgadget@gmail.com> In-Reply-To: From: Derrick Stolee 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 --- 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