1
0
Fork 0
mirror of https://github.com/git/git.git synced 2024-10-28 04:49:43 +01:00

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>
This commit is contained in:
Christian Couder 2020-06-11 14:05:07 +02:00 committed by Junio C Hamano
parent b1492f22f0
commit 446e42c559

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);
}
static void deepen_by_rev_list(struct packet_writer *writer, int ac,
const char **av,
struct object_array *shallows,
struct object_array *want_obj)
static void deepen_by_rev_list(struct upload_pack_data *data,
int ac,
const char **av)
{
struct commit_list *result;
disable_commit_graph(the_repository);
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);
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 */
@ -835,8 +834,7 @@ static int send_shallow_list(struct upload_pack_data *data)
struct object *o = data->want_obj.objects[i].item;
argv_array_push(&av, oid_to_hex(&o->oid));
}
deepen_by_rev_list(&data->writer, av.argc, av.argv,
&data->shallows, &data->want_obj);
deepen_by_rev_list(data, av.argc, av.argv);
argv_array_clear(&av);
ret = 1;
} else {