From: Derrick Stolee Date: Thu, 1 Apr 2021 01:49:53 +0000 (+0000) Subject: update-index: ensure full index X-Git-Tag: v2.32.0-rc0~59^2~10 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=2508df0272fdae3025b53366ac6b456920bc0de0;p=thirdparty%2Fgit.git update-index: 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 Reviewed-by: Elijah Newren Signed-off-by: Junio C Hamano --- diff --git a/builtin/update-index.c b/builtin/update-index.c index 79087bccea..f1f16f2de5 100644 --- a/builtin/update-index.c +++ b/builtin/update-index.c @@ -745,6 +745,8 @@ static int do_reupdate(int ac, const char **av, */ has_head = 0; redo: + /* TODO: audit for interaction with sparse-index. */ + ensure_full_index(&the_index); for (pos = 0; pos < active_nr; pos++) { const struct cache_entry *ce = active_cache[pos]; struct cache_entry *old = NULL;