Browse Source

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 4 years ago committed by Junio C Hamano
parent
commit
f7ef64be0c
  1. 2
      merge-recursive.c

2
merge-recursive.c

@ -522,6 +522,8 @@ static struct string_list *get_unmerged(struct index_state *istate) @@ -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;

Loading…
Cancel
Save