[PATCH v3 16/26] update-index: ensure full index
- From
Derrick Stolee via GitGitGadget <gitgitgadget@gmail.com>
- Date
- Apr 12, 2021, 21:08 UTC
- Message-ID
- <8c5336964d9b513825a9f7ac983ff06cc5757d2f.1618261698.git.gitgitgadget@gmail.com>
- In-Reply-To
- <pull.906.v3.git.1618261697.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 | 2 ++ 1 file changed, 2 insertions(+)
diff --git a/builtin/update-index.c b/builtin/update-index.c index 79087bccea4b..f1f16f2de526 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;
-- gitgitgadget