Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDerrick Stolee <dstolee@microsoft.com>2021-04-01 04:49:55 +0300
committerJunio C Hamano <gitster@pobox.com>2021-04-14 23:47:35 +0300
commit3450a304aaa20707a696176441a8bbfe6d5431a3 (patch)
tree4bb042e653a1f4ce83e7132d96efe865abf35c44 /entry.c
parentd425f65127562e3a7f308b1ccfe385950f96e8ec (diff)
entry: 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>
Diffstat (limited to 'entry.c')
-rw-r--r--entry.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/entry.c b/entry.c
index 7b9f43716f..891e4ba2b4 100644
--- a/entry.c
+++ b/entry.c
@@ -412,6 +412,8 @@ static void mark_colliding_entries(const struct checkout *state,
ce->ce_flags |= CE_MATCHED;
+ /* TODO: audit for interaction with sparse-index. */
+ ensure_full_index(state->istate);
for (i = 0; i < state->istate->cache_nr; i++) {
struct cache_entry *dup = state->istate->cache[i];