@matheusbsbs / matheus-bagliano / commits / 446e42c559
Fork 0

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>

Christian Couder committed Jun 11, 2020 at 14:05 UTC 446e42c559c79e7dae34b584fef4f7c26dee5198
1 file changed +6 -8
upload-pack.c
+6 -8
@@ -792,18 +792,17 @@ static void deepen(struct upload_pack_data *data, int depth)
792 send_unshallow(&data->writer, &data->shallows, &data->want_obj);
793 }
794
795 -static void deepen_by_rev_list(struct packet_writer *writer, int ac,
796 - const char **av,
797 - struct object_array *shallows,
798 - struct object_array *want_obj)
795 +static void deepen_by_rev_list(struct upload_pack_data *data,
796 + int ac,
797 + const char **av)
798 {
799 struct commit_list *result;
800
801 disable_commit_graph(the_repository);
802 result = get_shallow_commits_by_rev_list(ac, av, SHALLOW, NOT_SHALLOW);
804 - send_shallow(writer, result);
803 + send_shallow(&data->writer, result);
804 free_commit_list(result);
806 - send_unshallow(writer, shallows, want_obj);
805 + send_unshallow(&data->writer, &data->shallows, &data->want_obj);
806 }
807
808 /* 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)
834 struct object *o = data->want_obj.objects[i].item;
835 argv_array_push(&av, oid_to_hex(&o->oid));
836 }
838 - deepen_by_rev_list(&data->writer, av.argc, av.argv,
839 - &data->shallows, &data->want_obj);
837 + deepen_by_rev_list(data, av.argc, av.argv);
838 argv_array_clear(&av);
839 ret = 1;
840 } else {