[PATCH 19/27] entry: ensure full index

From
Derrick Stolee via GitGitGadget <hidden>
Date
2021-03-16 21:18:29
Reply to
Derrick Stolee via GitGitGadget, 2021-03-16
From: Derrick Stolee <redacted>

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 <redacted>
---
 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
Thread (105 messages) 105 messages, 5 authors, 2021-04-13
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help