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 <dstolee@microsoft.com> Reviewed-by: Elijah Newren <newren@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>maint
parent
a02912019a
commit
2508df0272
|
@ -745,6 +745,8 @@ static int do_reupdate(int ac, const char **av,
|
||||||
*/
|
*/
|
||||||
has_head = 0;
|
has_head = 0;
|
||||||
redo:
|
redo:
|
||||||
|
/* TODO: audit for interaction with sparse-index. */
|
||||||
|
ensure_full_index(&the_index);
|
||||||
for (pos = 0; pos < active_nr; pos++) {
|
for (pos = 0; pos < active_nr; pos++) {
|
||||||
const struct cache_entry *ce = active_cache[pos];
|
const struct cache_entry *ce = active_cache[pos];
|
||||||
struct cache_entry *old = NULL;
|
struct cache_entry *old = NULL;
|
||||||
|
|
Loading…
Reference in New Issue