Skip to content

Commit 6c34239

Browse files
newrengitster
authored andcommitted
unpack-trees: also allow get_progress() to work on a different index
commit b0a5a12 ("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 <[email protected]> Signed-off-by: Elijah Newren <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 5644ca2 commit 6c34239

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

unpack-trees.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -333,10 +333,10 @@ static void load_gitmodules_file(struct index_state *index,
333333
}
334334
}
335335

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)
337338
{
338339
unsigned cnt = 0, total = 0;
339-
struct index_state *index = &o->result;
340340

341341
if (!o->update || !o->verbose_update)
342342
return NULL;
@@ -414,7 +414,7 @@ static int check_updates(struct unpack_trees_options *o,
414414
if (o->clone)
415415
setup_collided_checkout_detection(&state, index);
416416

417-
progress = get_progress(o);
417+
progress = get_progress(o, index);
418418

419419
git_attr_set_direction(GIT_ATTR_CHECKOUT);
420420

0 commit comments

Comments
 (0)