Skip to content

Commit 762f927

Browse files
chriscoolgitster
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 438528f commit 762f927

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

upload-pack.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1059,14 +1059,15 @@ static int send_ref(const char *refname, const struct object_id *oid,
10591059
" deepen-relative no-progress include-tag multi_ack_detailed";
10601060
const char *refname_nons = strip_namespace(refname);
10611061
struct object_id peeled;
1062+
struct upload_pack_data *data = cb_data;
10621063

10631064
if (mark_our_ref(refname_nons, refname, oid))
10641065
return 0;
10651066

10661067
if (capabilities) {
10671068
struct strbuf symref_info = STRBUF_INIT;
10681069

1069-
format_symref_info(&symref_info, cb_data);
1070+
format_symref_info(&symref_info, &data->symref);
10701071
packet_write_fmt(1, "%s %s%c%s%s%s%s%s%s agent=%s\n",
10711072
oid_to_hex(oid), refname_nons,
10721073
0, capabilities,
@@ -1161,8 +1162,8 @@ void upload_pack(struct upload_pack_options *options)
11611162

11621163
if (options->advertise_refs || !stateless_rpc) {
11631164
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);
11661167
advertise_shallow_grafts(1);
11671168
packet_flush(1);
11681169
} else {

0 commit comments

Comments
 (0)