diff options
author | Christian Couder <christian.couder@gmail.com> | 2020-06-04 19:54:48 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2020-06-04 19:58:27 +0200 |
commit | d1d7a9452629a6caa26e80bd6ca69366ff65dd89 (patch) | |
tree | f42c253165e52c3d60cb150d1aec073124104b88 /upload-pack.c | |
parent | upload-pack: move allow_filter to upload_pack_data (diff) | |
download | git-d1d7a9452629a6caa26e80bd6ca69366ff65dd89.tar.xz git-d1d7a9452629a6caa26e80bd6ca69366ff65dd89.zip |
upload-pack: move allow_ref_in_want to upload_pack_data
As we cleanup 'upload-pack.c' by using 'struct upload_pack_data'
more thoroughly, let's move the 'allow_ref_in_want' 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>
Diffstat (limited to 'upload-pack.c')
-rw-r--r-- | upload-pack.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/upload-pack.c b/upload-pack.c index 19b342d4b0..0d75745d8d 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_ref_in_want; - static int allow_sideband_all; /* @@ -104,6 +102,7 @@ struct upload_pack_data { unsigned allow_filter : 1; unsigned done : 1; /* v2 only */ + unsigned allow_ref_in_want : 1; /* v2 only */ }; static void upload_pack_data_init(struct upload_pack_data *data) @@ -1145,7 +1144,7 @@ static int upload_pack_config(const char *var, const char *value, void *cb_data) } else if (!strcmp("uploadpack.allowfilter", var)) { data->allow_filter = git_config_bool(var, value); } else if (!strcmp("uploadpack.allowrefinwant", var)) { - allow_ref_in_want = git_config_bool(var, value); + data->allow_ref_in_want = git_config_bool(var, value); } else if (!strcmp("uploadpack.allowsidebandall", var)) { allow_sideband_all = git_config_bool(var, value); } else if (!strcmp("core.precomposeunicode", var)) { @@ -1289,7 +1288,7 @@ static void process_args(struct packet_reader *request, /* process want */ if (parse_want(&data->writer, arg, &data->want_obj)) continue; - if (allow_ref_in_want && + if (data->allow_ref_in_want && parse_want_ref(&data->writer, arg, &data->wanted_refs, &data->want_obj)) continue; |