Skip to content

Commit e3835cd

Browse files
chriscoolgitster
authored andcommitted
upload-pack: move allow_sideband_all to upload_pack_data
As we cleanup 'upload-pack.c' by using 'struct upload_pack_data' more thoroughly, let's move the 'allow_sideband_all' 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 d1d7a94 commit e3835cd

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_sideband_all;
59-
6058
/*
6159
* Please annotate, and if possible group together, fields used only
6260
* for protocol v0 or only for protocol v2.
@@ -103,6 +101,7 @@ struct upload_pack_data {
103101

104102
unsigned done : 1; /* v2 only */
105103
unsigned allow_ref_in_want : 1; /* v2 only */
104+
unsigned allow_sideband_all : 1; /* v2 only */
106105
};
107106

108107
static void upload_pack_data_init(struct upload_pack_data *data)
@@ -1146,7 +1145,7 @@ static int upload_pack_config(const char *var, const char *value, void *cb_data)
11461145
} else if (!strcmp("uploadpack.allowrefinwant", var)) {
11471146
data->allow_ref_in_want = git_config_bool(var, value);
11481147
} else if (!strcmp("uploadpack.allowsidebandall", var)) {
1149-
allow_sideband_all = git_config_bool(var, value);
1148+
data->allow_sideband_all = git_config_bool(var, value);
11501149
} else if (!strcmp("core.precomposeunicode", var)) {
11511150
precomposed_unicode = git_config_bool(var, value);
11521151
}
@@ -1341,7 +1340,7 @@ static void process_args(struct packet_reader *request,
13411340
}
13421341

13431342
if ((git_env_bool("GIT_TEST_SIDEBAND_ALL", 0) ||
1344-
allow_sideband_all) &&
1343+
data->allow_sideband_all) &&
13451344
!strcmp(arg, "sideband-all")) {
13461345
data->writer.use_sideband = 1;
13471346
continue;

0 commit comments

Comments
 (0)