mirror of
https://github.com/git/git.git
synced 2025-12-12 20:36:24 +01:00
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>
This commit is contained in:
committed by
Junio C Hamano
parent
d425f65127
commit
3450a304aa
2
entry.c
2
entry.c
@@ -412,6 +412,8 @@ static void mark_colliding_entries(const struct checkout *state,
|
|||||||
|
|
||||||
ce->ce_flags |= CE_MATCHED;
|
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++) {
|
for (i = 0; i < state->istate->cache_nr; i++) {
|
||||||
struct cache_entry *dup = state->istate->cache[i];
|
struct cache_entry *dup = state->istate->cache[i];
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user