aboutsummaryrefslogtreecommitdiffstats
path: root/upload-pack.c
diff options
context:
space:
mode:
authorJonathan Tan <jonathantanmy@google.com>2019-01-16 11:28:15 -0800
committerJunio C Hamano <gitster@pobox.com>2019-01-17 11:25:07 -0800
commit07c3c2aa16370fd97551b7d1aa6af3d051e7cf8f (patch)
treec1cbc5c854f9802361f09189534ad73e621fdbdd /upload-pack.c
parent0bbc0bc5745ab8b294a5faf8c3b1d939ae8b6d10 (diff)
downloadgit-07c3c2aa16370fd97551b7d1aa6af3d051e7cf8f.tar.gz
tests: define GIT_TEST_SIDEBAND_ALL
Define a GIT_TEST_SIDEBAND_ALL environment variable meant to be used from tests. When set to true, this overrides uploadpack.allowsidebandall to true, allowing the entire test suite to be run as if this configuration is in place for all repositories. As of this patch, all tests pass whether GIT_TEST_SIDEBAND_ALL is unset or set to 1. Signed-off-by: Jonathan Tan <jonathantanmy@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'upload-pack.c')
-rw-r--r--upload-pack.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/upload-pack.c b/upload-pack.c
index 765b7695d2..0c1feccaab 100644
--- a/upload-pack.c
+++ b/upload-pack.c
@@ -1288,7 +1288,9 @@ static void process_args(struct packet_reader *request,
continue;
}
- if (allow_sideband_all && !strcmp(arg, "sideband-all")) {
+ if ((git_env_bool("GIT_TEST_SIDEBAND_ALL", 0) ||
+ allow_sideband_all) &&
+ !strcmp(arg, "sideband-all")) {
data->writer.use_sideband = 1;
continue;
}
@@ -1521,10 +1523,11 @@ int upload_pack_advertise(struct repository *r,
allow_ref_in_want)
strbuf_addstr(value, " ref-in-want");
- if (!repo_config_get_bool(the_repository,
- "uploadpack.allowsidebandall",
- &allow_sideband_all_value) &&
- allow_sideband_all_value)
+ if (git_env_bool("GIT_TEST_SIDEBAND_ALL", 0) ||
+ (!repo_config_get_bool(the_repository,
+ "uploadpack.allowsidebandall",
+ &allow_sideband_all_value) &&
+ allow_sideband_all_value))
strbuf_addstr(value, " sideband-all");
}