]> git.ipfire.org Git - thirdparty/git.git/commitdiff
merge-recursive: ensure full index
authorDerrick Stolee <dstolee@microsoft.com>
Thu, 1 Apr 2021 01:49:56 +0000 (01:49 +0000)
committerJunio C Hamano <gitster@pobox.com>
Wed, 14 Apr 2021 20:47:37 +0000 (13:47 -0700)
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>
merge-recursive.c

index b8de7a704eae4a85e8d869d28ff047c659e92876..91d8597728c1a1efbdcfaf1014cf79a405e9b0b3 100644 (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;