Skip to content

Commit 37aa89b

Browse files
peffgitster
authored andcommitted
upload-pack: centralize setup of sideband-all config
We read uploadpack.allowsidebandall to set a matching flag in our upload_pack_data struct. But for our tests, we also respect GIT_TEST_SIDEBAND_ALL from the environment, and anybody looking at the flag in the struct needs to remember to check both. There's only one such piece of code now, but we're about to add another. So let's have the config step actually fold the environment value into the struct, letting the rest of the code use the flag in the obvious way. Signed-off-by: Jeff King <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 922fdef commit 37aa89b

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

upload-pack.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1390,6 +1390,8 @@ static void get_upload_pack_config(struct repository *r,
13901390
{
13911391
repo_config(r, upload_pack_config, data);
13921392
git_protected_config(upload_pack_protected_config, data);
1393+
1394+
data->allow_sideband_all |= git_env_bool("GIT_TEST_SIDEBAND_ALL", 0);
13931395
}
13941396

13951397
void upload_pack(const int advertise_refs, const int stateless_rpc,
@@ -1639,8 +1641,7 @@ static void process_args(struct packet_reader *request,
16391641
continue;
16401642
}
16411643

1642-
if ((git_env_bool("GIT_TEST_SIDEBAND_ALL", 0) ||
1643-
data->allow_sideband_all) &&
1644+
if (data->allow_sideband_all &&
16441645
!strcmp(arg, "sideband-all")) {
16451646
data->writer.use_sideband = 1;
16461647
continue;

0 commit comments

Comments
 (0)