upload-pack: move allow_filter to upload_pack_data
As we cleanup 'upload-pack.c' by using 'struct upload_pack_data' more thoroughly, let's move the 'allow_filter' static variable into this struct. It is used by both protocol v0 and 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>
This commit is contained in:
parent
f203a88cf1
commit
59abe19624
@ -55,7 +55,6 @@ static int shallow_nr;
|
|||||||
static struct object_array extra_edge_obj;
|
static struct object_array extra_edge_obj;
|
||||||
static const char *pack_objects_hook;
|
static const char *pack_objects_hook;
|
||||||
|
|
||||||
static int allow_filter;
|
|
||||||
static int allow_ref_in_want;
|
static int allow_ref_in_want;
|
||||||
|
|
||||||
static int allow_sideband_all;
|
static int allow_sideband_all;
|
||||||
@ -102,6 +101,7 @@ struct upload_pack_data {
|
|||||||
unsigned use_ofs_delta : 1;
|
unsigned use_ofs_delta : 1;
|
||||||
unsigned no_progress : 1;
|
unsigned no_progress : 1;
|
||||||
unsigned use_include_tag : 1;
|
unsigned use_include_tag : 1;
|
||||||
|
unsigned allow_filter : 1;
|
||||||
|
|
||||||
unsigned done : 1; /* v2 only */
|
unsigned done : 1; /* v2 only */
|
||||||
};
|
};
|
||||||
@ -984,7 +984,8 @@ static void receive_needs(struct upload_pack_data *data,
|
|||||||
data->no_progress = 1;
|
data->no_progress = 1;
|
||||||
if (parse_feature_request(features, "include-tag"))
|
if (parse_feature_request(features, "include-tag"))
|
||||||
data->use_include_tag = 1;
|
data->use_include_tag = 1;
|
||||||
if (allow_filter && parse_feature_request(features, "filter"))
|
if (data->allow_filter &&
|
||||||
|
parse_feature_request(features, "filter"))
|
||||||
data->filter_capability_requested = 1;
|
data->filter_capability_requested = 1;
|
||||||
|
|
||||||
o = parse_object(the_repository, &oid_buf);
|
o = parse_object(the_repository, &oid_buf);
|
||||||
@ -1090,7 +1091,7 @@ static int send_ref(const char *refname, const struct object_id *oid,
|
|||||||
" allow-reachable-sha1-in-want" : "",
|
" allow-reachable-sha1-in-want" : "",
|
||||||
data->stateless_rpc ? " no-done" : "",
|
data->stateless_rpc ? " no-done" : "",
|
||||||
symref_info.buf,
|
symref_info.buf,
|
||||||
allow_filter ? " filter" : "",
|
data->allow_filter ? " filter" : "",
|
||||||
git_user_agent_sanitized());
|
git_user_agent_sanitized());
|
||||||
strbuf_release(&symref_info);
|
strbuf_release(&symref_info);
|
||||||
} else {
|
} else {
|
||||||
@ -1142,7 +1143,7 @@ static int upload_pack_config(const char *var, const char *value, void *cb_data)
|
|||||||
if (!data->keepalive)
|
if (!data->keepalive)
|
||||||
data->keepalive = -1;
|
data->keepalive = -1;
|
||||||
} else if (!strcmp("uploadpack.allowfilter", var)) {
|
} else if (!strcmp("uploadpack.allowfilter", var)) {
|
||||||
allow_filter = git_config_bool(var, value);
|
data->allow_filter = git_config_bool(var, value);
|
||||||
} else if (!strcmp("uploadpack.allowrefinwant", var)) {
|
} else if (!strcmp("uploadpack.allowrefinwant", var)) {
|
||||||
allow_ref_in_want = git_config_bool(var, value);
|
allow_ref_in_want = git_config_bool(var, value);
|
||||||
} else if (!strcmp("uploadpack.allowsidebandall", var)) {
|
} else if (!strcmp("uploadpack.allowsidebandall", var)) {
|
||||||
@ -1334,7 +1335,7 @@ static void process_args(struct packet_reader *request,
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (allow_filter && skip_prefix(arg, "filter ", &p)) {
|
if (data->allow_filter && skip_prefix(arg, "filter ", &p)) {
|
||||||
list_objects_filter_die_if_populated(&data->filter_options);
|
list_objects_filter_die_if_populated(&data->filter_options);
|
||||||
parse_list_objects_filter(&data->filter_options, p);
|
parse_list_objects_filter(&data->filter_options, p);
|
||||||
continue;
|
continue;
|
||||||
|
Loading…
Reference in New Issue
Block a user