upload-pack: pass upload_pack_data to deepen_by_rev_list()

As we cleanup 'upload-pack.c' by using 'struct upload_pack_data'
more thoroughly, let's pass that struct to deepen_by_rev_list(),
so that this function can use all the fields of the struct.

This will be used in followup commits to move static variables
into 'upload_pack_data'.

Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
maint
Christian Couder 2020-06-11 14:05:07 +02:00 committed by Junio C Hamano
parent b1492f22f0
commit 446e42c559
1 changed files with 6 additions and 8 deletions

View File

@ -792,18 +792,17 @@ static void deepen(struct upload_pack_data *data, int depth)
send_unshallow(&data->writer, &data->shallows, &data->want_obj); send_unshallow(&data->writer, &data->shallows, &data->want_obj);
} }


static void deepen_by_rev_list(struct packet_writer *writer, int ac, static void deepen_by_rev_list(struct upload_pack_data *data,
const char **av, int ac,
struct object_array *shallows, const char **av)
struct object_array *want_obj)
{ {
struct commit_list *result; struct commit_list *result;


disable_commit_graph(the_repository); disable_commit_graph(the_repository);
result = get_shallow_commits_by_rev_list(ac, av, SHALLOW, NOT_SHALLOW); result = get_shallow_commits_by_rev_list(ac, av, SHALLOW, NOT_SHALLOW);
send_shallow(writer, result); send_shallow(&data->writer, result);
free_commit_list(result); free_commit_list(result);
send_unshallow(writer, shallows, want_obj); send_unshallow(&data->writer, &data->shallows, &data->want_obj);
} }


/* Returns 1 if a shallow list is sent or 0 otherwise */ /* Returns 1 if a shallow list is sent or 0 otherwise */
@ -835,8 +834,7 @@ static int send_shallow_list(struct upload_pack_data *data)
struct object *o = data->want_obj.objects[i].item; struct object *o = data->want_obj.objects[i].item;
argv_array_push(&av, oid_to_hex(&o->oid)); argv_array_push(&av, oid_to_hex(&o->oid));
} }
deepen_by_rev_list(&data->writer, av.argc, av.argv, deepen_by_rev_list(data, av.argc, av.argv);
&data->shallows, &data->want_obj);
argv_array_clear(&av); argv_array_clear(&av);
ret = 1; ret = 1;
} else { } else {