summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDerrick Stolee <dstolee@microsoft.com>2021-04-01 01:49:56 (GMT)
committerJunio C Hamano <gitster@pobox.com>2021-04-14 20:47:37 (GMT)
commitf7ef64be0cda36e5188cfc712f61ba7279311b70 (patch)
treefc9f6c4c27624980dc20877713afbcbc345402b8
parent3450a304aaa20707a696176441a8bbfe6d5431a3 (diff)
downloadgit-f7ef64be0cda36e5188cfc712f61ba7279311b70.zip
git-f7ef64be0cda36e5188cfc712f61ba7279311b70.tar.gz
git-f7ef64be0cda36e5188cfc712f61ba7279311b70.tar.bz2
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>
-rw-r--r--merge-recursive.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/merge-recursive.c b/merge-recursive.c
index b8de7a7..91d8597 100644
--- a/merge-recursive.c
+++ b/merge-recursive.c
@@ -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;