@matheusbsbs / matheus-bagliano / commits / e3835cd4bc
Fork 0

upload-pack: move allow_sideband_all to upload_pack_data

As we cleanup 'upload-pack.c' by using 'struct upload_pack_data' more thoroughly, let's move the 'allow_sideband_all' static variable into this struct. It is used only by protocol v2 code. 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 e3835cd4bc6d727bf16a42229c0ca757c088e9d3
1 file changed +3 -4
upload-pack.c
+3 -4
@@ -55,8 +55,6 @@ static int shallow_nr;
55 static struct object_array extra_edge_obj;
56 static const char *pack_objects_hook;
57
58 -static int allow_sideband_all;
59 -
58 /*
59 * Please annotate, and if possible group together, fields used only
60 * for protocol v0 or only for protocol v2.
@@ -103,6 +101,7 @@ struct upload_pack_data {
101
102 unsigned done : 1; /* v2 only */
103 unsigned allow_ref_in_want : 1; /* v2 only */
104 + unsigned allow_sideband_all : 1; /* v2 only */
105 };
106
107 static void upload_pack_data_init(struct upload_pack_data *data)
@@ -1146,7 +1145,7 @@ static int upload_pack_config(const char *var, const char *value, void *cb_data)
1145 } else if (!strcmp("uploadpack.allowrefinwant", var)) {
1146 data->allow_ref_in_want = git_config_bool(var, value);
1147 } else if (!strcmp("uploadpack.allowsidebandall", var)) {
1149 - allow_sideband_all = git_config_bool(var, value);
1148 + data->allow_sideband_all = git_config_bool(var, value);
1149 } else if (!strcmp("core.precomposeunicode", var)) {
1150 precomposed_unicode = git_config_bool(var, value);
1151 }
@@ -1341,7 +1340,7 @@ static void process_args(struct packet_reader *request,
1340 }
1341
1342 if ((git_env_bool("GIT_TEST_SIDEBAND_ALL", 0) ||
1344 - allow_sideband_all) &&
1343 + data->allow_sideband_all) &&
1344 !strcmp(arg, "sideband-all")) {
1345 data->writer.use_sideband = 1;
1346 continue;