merge-recursive: 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 <dstolee@microsoft.com>
Reviewed-by: Elijah Newren <newren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
maint
Derrick Stolee 2021-04-01 01:49:56 +00:00 committed by Junio C Hamano
parent 3450a304aa
commit f7ef64be0c
1 changed files with 2 additions and 0 deletions

View File

@ -522,6 +522,8 @@ static struct string_list *get_unmerged(struct index_state *istate)

unmerged->strdup_strings = 1;

/* TODO: audit for interaction with sparse-index. */
ensure_full_index(istate);
for (i = 0; i < istate->cache_nr; i++) {
struct string_list_item *item;
struct stage_data *e;