Skip to content

Commit 3450a30

Browse files
derrickstoleegitster
authored andcommitted
entry: ensure full index
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 <[email protected]> Reviewed-by: Elijah Newren <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent d425f65 commit 3450a30

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

entry.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -412,6 +412,8 @@ static void mark_colliding_entries(const struct checkout *state,
412412

413413
ce->ce_flags |= CE_MATCHED;
414414

415+
/* TODO: audit for interaction with sparse-index. */
416+
ensure_full_index(state->istate);
415417
for (i = 0; i < state->istate->cache_nr; i++) {
416418
struct cache_entry *dup = state->istate->cache[i];
417419

0 commit comments

Comments
 (0)