summaryrefslogtreecommitdiff
path: root/unpack-trees.c
diff options
context:
space:
mode:
authorElijah Newren <newren@gmail.com>2020-03-27 00:48:49 (GMT)
committerJunio C Hamano <gitster@pobox.com>2020-03-27 18:33:29 (GMT)
commitb0a5a12a60393237f98ec4b0fcf2b7d3c3232a2a (patch)
tree8f25177e052ac6448945433761908ac2476b4b19 /unpack-trees.c
parent72064ee578a59d4511cab17496c5246af02397f3 (diff)
downloadgit-b0a5a12a60393237f98ec4b0fcf2b7d3c3232a2a.zip
git-b0a5a12a60393237f98ec4b0fcf2b7d3c3232a2a.tar.gz
git-b0a5a12a60393237f98ec4b0fcf2b7d3c3232a2a.tar.bz2
unpack-trees: allow check_updates() to work on a different index
check_updates() previously assumed it was working on o->result. We want to use this function in combination with a different index_state, so take the intended index_state as a parameter. Reviewed-by: Derrick Stolee <dstolee@microsoft.com> Signed-off-by: Elijah Newren <newren@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'unpack-trees.c')
-rw-r--r--unpack-trees.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/unpack-trees.c b/unpack-trees.c
index d2863fa..dde5004 100644
--- a/unpack-trees.c
+++ b/unpack-trees.c
@@ -353,12 +353,12 @@ static void report_collided_checkout(struct index_state *index)
string_list_clear(&list, 0);
}
-static int check_updates(struct unpack_trees_options *o)
+static int check_updates(struct unpack_trees_options *o,
+ struct index_state *index)
{
unsigned cnt = 0;
int errs = 0;
struct progress *progress;
- struct index_state *index = &o->result;
struct checkout state = CHECKOUT_INIT;
int i;
@@ -1665,7 +1665,7 @@ int unpack_trees(unsigned len, struct tree_desc *t, struct unpack_trees_options
}
}
- ret = check_updates(o) ? (-2) : 0;
+ ret = check_updates(o, &o->result) ? (-2) : 0;
if (o->dst_index) {
move_index_extensions(&o->result, o->src_index);
if (!ret) {