]> git.ipfire.org Git - thirdparty/git.git/blobdiff - unpack-trees.c
unpack-trees: also allow get_progress() to work on a different index
[thirdparty/git.git] / unpack-trees.c
index b43f3e775ad858f16f14078e798ea5718316bf49..8caf5e8ecc43e10b835279d915548b0d424ba6e6 100644 (file)
@@ -333,10 +333,10 @@ static void load_gitmodules_file(struct index_state *index,
        }
 }
 
-static struct progress *get_progress(struct unpack_trees_options *o)
+static struct progress *get_progress(struct unpack_trees_options *o,
+                                    struct index_state *index)
 {
        unsigned cnt = 0, total = 0;
-       struct index_state *index = &o->result;
 
        if (!o->update || !o->verbose_update)
                return NULL;
@@ -414,7 +414,7 @@ static int check_updates(struct unpack_trees_options *o,
        if (o->clone)
                setup_collided_checkout_detection(&state, index);
 
-       progress = get_progress(o);
+       progress = get_progress(o, index);
 
        git_attr_set_direction(GIT_ATTR_CHECKOUT);