Skip to content

Commit d1d7a94

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

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

upload-pack.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,6 @@ static int shallow_nr;
5555
static struct object_array extra_edge_obj;
5656
static const char *pack_objects_hook;
5757

58-
static int allow_ref_in_want;
59-
6058
static int allow_sideband_all;
6159

6260
/*
@@ -104,6 +102,7 @@ struct upload_pack_data {
104102
unsigned allow_filter : 1;
105103

106104
unsigned done : 1; /* v2 only */
105+
unsigned allow_ref_in_want : 1; /* v2 only */
107106
};
108107

109108
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)
11451144
} else if (!strcmp("uploadpack.allowfilter", var)) {
11461145
data->allow_filter = git_config_bool(var, value);
11471146
} else if (!strcmp("uploadpack.allowrefinwant", var)) {
1148-
allow_ref_in_want = git_config_bool(var, value);
1147+
data->allow_ref_in_want = git_config_bool(var, value);
11491148
} else if (!strcmp("uploadpack.allowsidebandall", var)) {
11501149
allow_sideband_all = git_config_bool(var, value);
11511150
} else if (!strcmp("core.precomposeunicode", var)) {
@@ -1289,7 +1288,7 @@ static void process_args(struct packet_reader *request,
12891288
/* process want */
12901289
if (parse_want(&data->writer, arg, &data->want_obj))
12911290
continue;
1292-
if (allow_ref_in_want &&
1291+
if (data->allow_ref_in_want &&
12931292
parse_want_ref(&data->writer, arg, &data->wanted_refs,
12941293
&data->want_obj))
12951294
continue;

0 commit comments

Comments
 (0)