Skip to content

Commit 2508df0

Browse files
derrickstoleegitster
authored andcommitted
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 <[email protected]> Reviewed-by: Elijah Newren <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent a029120 commit 2508df0

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

builtin/update-index.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -745,6 +745,8 @@ static int do_reupdate(int ac, const char **av,
745745
*/
746746
has_head = 0;
747747
redo:
748+
/* TODO: audit for interaction with sparse-index. */
749+
ensure_full_index(&the_index);
748750
for (pos = 0; pos < active_nr; pos++) {
749751
const struct cache_entry *ce = active_cache[pos];
750752
struct cache_entry *old = NULL;

0 commit comments

Comments
 (0)