Skip to content

Commit 59a9026

Browse files
chriscoolgitster
authored andcommitted
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 <[email protected]> Acked-by: Jeff King <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent f8edd1c commit 59a9026

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

upload-pack.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,6 @@ static struct object_array extra_edge_obj;
5757
static int keepalive = 5;
5858
static const char *pack_objects_hook;
5959

60-
static int filter_capability_requested;
6160
static int allow_filter;
6261
static int allow_ref_in_want;
6362

@@ -93,6 +92,7 @@ struct upload_pack_data {
9392
unsigned stateless_rpc : 1; /* v0 only */
9493
unsigned no_done : 1; /* v0 only */
9594
unsigned daemon_mode : 1; /* v0 only */
95+
unsigned filter_capability_requested : 1; /* v0 only */
9696

9797
unsigned use_thin_pack : 1;
9898
unsigned use_ofs_delta : 1;
@@ -943,7 +943,7 @@ static void receive_needs(struct upload_pack_data *data,
943943
continue;
944944

945945
if (skip_prefix(reader->line, "filter ", &arg)) {
946-
if (!filter_capability_requested)
946+
if (!data->filter_capability_requested)
947947
die("git upload-pack: filtering capability not negotiated");
948948
list_objects_filter_die_if_populated(&data->filter_options);
949949
parse_list_objects_filter(&data->filter_options, arg);
@@ -976,7 +976,7 @@ static void receive_needs(struct upload_pack_data *data,
976976
if (parse_feature_request(features, "include-tag"))
977977
data->use_include_tag = 1;
978978
if (allow_filter && parse_feature_request(features, "filter"))
979-
filter_capability_requested = 1;
979+
data->filter_capability_requested = 1;
980980

981981
o = parse_object(the_repository, &oid_buf);
982982
if (!o) {

0 commit comments

Comments
 (0)