[11/12] upload-pack: move allow_sideband_all to upload_pack_data
diff mbox series

Message ID 20200527164742.23067-12-chriscool@tuxfamily.org
State New
Headers show
Series
  • upload-pack: use 'struct upload_pack_data' thoroughly, part 2
Related show

Commit Message

Christian Couder May 27, 2020, 4:47 p.m. UTC
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>
---
 upload-pack.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

Patch
diff mbox series

diff --git a/upload-pack.c b/upload-pack.c
index b5647eb47c..becefd5bdc 100644
--- a/upload-pack.c
+++ b/upload-pack.c
@@ -55,8 +55,6 @@  static int shallow_nr;
 static struct object_array extra_edge_obj;
 static const char *pack_objects_hook;
 
-static int allow_sideband_all;
-
 struct upload_pack_data {
 	struct string_list symref;
 	struct string_list wanted_refs;
@@ -99,6 +97,7 @@  struct upload_pack_data {
 
 	unsigned allow_filter : 1;
 	unsigned allow_ref_in_want : 1;
+	unsigned allow_sideband_all : 1;
 };
 
 static void upload_pack_data_init(struct upload_pack_data *data)
@@ -1142,7 +1141,7 @@  static int upload_pack_config(const char *var, const char *value, void *cb_data)
 	} else if (!strcmp("uploadpack.allowrefinwant", var)) {
 		data->allow_ref_in_want = git_config_bool(var, value);
 	} else if (!strcmp("uploadpack.allowsidebandall", var)) {
-		allow_sideband_all = git_config_bool(var, value);
+		data->allow_sideband_all = git_config_bool(var, value);
 	} else if (!strcmp("core.precomposeunicode", var)) {
 		precomposed_unicode = git_config_bool(var, value);
 	}
@@ -1337,7 +1336,7 @@  static void process_args(struct packet_reader *request,
 		}
 
 		if ((git_env_bool("GIT_TEST_SIDEBAND_ALL", 0) ||
-		     allow_sideband_all) &&
+		     data->allow_sideband_all) &&
 		    !strcmp(arg, "sideband-all")) {
 			data->writer.use_sideband = 1;
 			continue;