@matheusbsbs / matheus-bagliano / commits / 6c34239de6
Fork 0

unpack-trees: also allow get_progress() to work on a different index

commit b0a5a12a60 ("unpack-trees: allow check_updates() to work on a different index", 2020-03-27) allowed check_updates() to work on a different index, but it called get_progress() which was hardcoded to work on o->result much like check_updates() had been. Update it to also accept an index parameter and have check_updates() pass that parameter along so that both are working on the same index. Noticed-by: Jeff Hostetler <jeffhost@microsoft.com> Signed-off-by: Elijah Newren <newren@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Elijah Newren committed May 14, 2020 at 19:53 UTC 6c34239de67e03390622dfad14d91ed3ce1048b5
1 file changed +3 -3
unpack-trees.c
+3 -3
@@ -333,10 +333,10 @@ static void load_gitmodules_file(struct index_state *index,
333 }
334 }
335
336 -static struct progress *get_progress(struct unpack_trees_options *o)
336 +static struct progress *get_progress(struct unpack_trees_options *o,
337 + struct index_state *index)
338 {
339 unsigned cnt = 0, total = 0;
339 - struct index_state *index = &o->result;
340
341 if (!o->update || !o->verbose_update)
342 return NULL;
@@ -414,7 +414,7 @@ static int check_updates(struct unpack_trees_options *o,
414 if (o->clone)
415 setup_collided_checkout_detection(&state, index);
416
417 - progress = get_progress(o);
417 + progress = get_progress(o, index);
418
419 git_attr_set_direction(GIT_ATTR_CHECKOUT);
420