upload-pack: pass upload_pack_data to upload_pack_config()
As we cleanup 'upload-pack.c' by using 'struct upload_pack_data' more thoroughly, let's pass that struct to upload_pack_config(), so that this function can use all the fields of the struct. This will be used in followup commits to move static variables that are set in upload_pack_config() into 'upload_pack_data'. Signed-off-by: Christian Couder <chriscool@tuxfamily.org> Acked-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Christian Couder committed
Jun 4, 2020 at 19:54 UTC
8a0e6f16ca4cadefc99343609351dbb0eccf8be7
1 file changed
+5
-5
upload-pack.c
+5
-5
@@ -1113,7 +1113,7 @@ static int find_symref(const char *refname, const struct object_id *oid,
1113
return 0;
1114
}
1115
1116
-static int upload_pack_config(const char *var, const char *value, void *unused)
1116
+static int upload_pack_config(const char *var, const char *value, void *cb_data)
1117
{
1118
if (!strcmp("uploadpack.allowtipsha1inwant", var)) {
1119
if (git_config_bool(var, value))
@@ -1158,10 +1158,10 @@ void upload_pack(struct upload_pack_options *options)
1158
struct packet_reader reader;
1159
struct upload_pack_data data;
1160
1161
- git_config(upload_pack_config, NULL);
1162
-
1161
upload_pack_data_init(&data);
1162
1163
+ git_config(upload_pack_config, &data);
1164
+
1165
data.stateless_rpc = options->stateless_rpc;
1166
data.daemon_mode = options->daemon_mode;
1167
data.timeout = options->timeout;
@@ -1491,11 +1491,11 @@ int upload_pack_v2(struct repository *r, struct argv_array *keys,
1491
1492
clear_object_flags(ALL_FLAGS);
1493
1494
- git_config(upload_pack_config, NULL);
1495
-
1494
upload_pack_data_init(&data);
1495
data.use_sideband = LARGE_PACKET_MAX;
1496
1497
+ git_config(upload_pack_config, &data);
1498
+
1499
while (state != FETCH_DONE) {
1500
switch (state) {
1501
case FETCH_PROCESS_ARGS: