summaryrefslogtreecommitdiff
path: root/upload-pack.c
diff options
context:
space:
mode:
authorChristian Couder <christian.couder@gmail.com>2020-06-04 17:54:42 (GMT)
committerJunio C Hamano <gitster@pobox.com>2020-06-04 17:58:26 (GMT)
commit59a902612ab2cdea2a30882e90680a1e7618f823 (patch)
treec5b889eb177e2de8987138bef825b7586be65e67 /upload-pack.c
parentf8edd1ca3c02dc8fd1f302e80557fb7eff8b724d (diff)
downloadgit-59a902612ab2cdea2a30882e90680a1e7618f823.zip
git-59a902612ab2cdea2a30882e90680a1e7618f823.tar.gz
git-59a902612ab2cdea2a30882e90680a1e7618f823.tar.bz2
upload-pack: move filter_capability_requested to upload_pack_data
As we cleanup 'upload-pack.c' by using 'struct upload_pack_data' more thoroughly, let's move the filter_capability_requested static variable into this struct. It is only used by protocol v0 code since protocol v2 assumes certain baseline capabilities, but rolling it into upload_pack_data and just letting v2 code ignore it as it does now is more coherent and cleaner. 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.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/upload-pack.c b/upload-pack.c
index 07798fd..6226387 100644
--- a/upload-pack.c
+++ b/upload-pack.c
@@ -57,7 +57,6 @@ static struct object_array extra_edge_obj;
static int keepalive = 5;
static const char *pack_objects_hook;
-static int filter_capability_requested;
static int allow_filter;
static int allow_ref_in_want;
@@ -93,6 +92,7 @@ struct upload_pack_data {
unsigned stateless_rpc : 1; /* v0 only */
unsigned no_done : 1; /* v0 only */
unsigned daemon_mode : 1; /* v0 only */
+ unsigned filter_capability_requested : 1; /* v0 only */
unsigned use_thin_pack : 1;
unsigned use_ofs_delta : 1;
@@ -943,7 +943,7 @@ static void receive_needs(struct upload_pack_data *data,
continue;
if (skip_prefix(reader->line, "filter ", &arg)) {
- if (!filter_capability_requested)
+ if (!data->filter_capability_requested)
die("git upload-pack: filtering capability not negotiated");
list_objects_filter_die_if_populated(&data->filter_options);
parse_list_objects_filter(&data->filter_options, arg);
@@ -976,7 +976,7 @@ static void receive_needs(struct upload_pack_data *data,
if (parse_feature_request(features, "include-tag"))
data->use_include_tag = 1;
if (allow_filter && parse_feature_request(features, "filter"))
- filter_capability_requested = 1;
+ data->filter_capability_requested = 1;
o = parse_object(the_repository, &oid_buf);
if (!o) {