@matheusbsbs / matheus-bagliano / commits / 762f92767c
Fork 0

upload-pack: pass upload_pack_data to send_ref()

As we cleanup 'upload-pack.c' by using 'struct upload_pack_data' more thoroughly, let's pass that struct to send_ref(), so that this function, and the functions it calls, can use all the fields of the struct in followup commits. Signed-off-by: Christian Couder <chriscool@tuxfamily.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Christian Couder committed May 15, 2020 at 12:04 UTC 762f92767c5d1f1d708f6656363f26bfb700f83a
1 file changed +4 -3
upload-pack.c
+4 -3
@@ -1059,6 +1059,7 @@ static int send_ref(const char *refname, const struct object_id *oid,
1059 " deepen-relative no-progress include-tag multi_ack_detailed";
1060 const char *refname_nons = strip_namespace(refname);
1061 struct object_id peeled;
1062 + struct upload_pack_data *data = cb_data;
1063
1064 if (mark_our_ref(refname_nons, refname, oid))
1065 return 0;
@@ -1066,7 +1067,7 @@ static int send_ref(const char *refname, const struct object_id *oid,
1067 if (capabilities) {
1068 struct strbuf symref_info = STRBUF_INIT;
1069
1069 - format_symref_info(&symref_info, cb_data);
1070 + format_symref_info(&symref_info, &data->symref);
1071 packet_write_fmt(1, "%s %s%c%s%s%s%s%s%s agent=%s\n",
1072 oid_to_hex(oid), refname_nons,
1073 0, capabilities,
@@ -1161,8 +1162,8 @@ void upload_pack(struct upload_pack_options *options)
1162
1163 if (options->advertise_refs || !stateless_rpc) {
1164 reset_timeout();
1164 - head_ref_namespaced(send_ref, &data.symref);
1165 - for_each_namespaced_ref(send_ref, &data.symref);
1165 + head_ref_namespaced(send_ref, &data);
1166 + for_each_namespaced_ref(send_ref, &data);
1167 advertise_shallow_grafts(1);
1168 packet_flush(1);
1169 } else {