[PATCH 16/27] update-index: ensure full index
- From
Derrick Stolee via GitGitGadget <gitgitgadget@gmail.com>
- Date
- Mar 16, 2021, 21:17 UTC
- Message-ID
- <796449758a08ad9f2038f16c7d157edf27ca3cc4.1615929436.git.gitgitgadget@gmail.com>
- In-Reply-To
- <pull.906.git.1615929435.gitgitgadget@gmail.com>
From: Derrick Stolee <dstolee@microsoft.com>
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> --- builtin/update-index.c | 1 + 1 file changed, 1 insertion(+)
diff --git a/builtin/update-index.c b/builtin/update-index.c index 79087bccea4b..8eb654ddc754 100644 --- a/builtin/update-index.c +++ b/builtin/update-index.c @@ -745,6 +745,7 @@ static int do_reupdate(int ac, const char **av, */ has_head = 0; redo: + 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;
-- gitgitgadget