summaryrefslogtreecommitdiff
path: root/repo-settings.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2022-02-16 23:14:30 (GMT)
committerJunio C Hamano <gitster@pobox.com>2022-02-16 23:14:30 (GMT)
commit70ff41ffcf93aed8198368af435b0c53fe55ed05 (patch)
tree4dad3dd2bde82a7db5e9cc5789691fabd80b7348 /repo-settings.c
parent00e38ba6d801143a10f762d781e3e885243caa42 (diff)
parent714edc620c7ddca5d54ff148ac27da6b67217012 (diff)
downloadgit-70ff41ffcf93aed8198368af435b0c53fe55ed05.zip
git-70ff41ffcf93aed8198368af435b0c53fe55ed05.tar.gz
git-70ff41ffcf93aed8198368af435b0c53fe55ed05.tar.bz2
Merge branch 'en/fetch-negotiation-default-fix'
Interaction between fetch.negotiationAlgorithm and feature.experimental configuration variables has been corrected. * en/fetch-negotiation-default-fix: repo-settings: rename the traditional default fetch.negotiationAlgorithm repo-settings: fix error handling for unknown values repo-settings: fix checking for fetch.negotiationAlgorithm=default
Diffstat (limited to 'repo-settings.c')
-rw-r--r--repo-settings.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/repo-settings.c b/repo-settings.c
index 00ca557..b4fbd16 100644
--- a/repo-settings.c
+++ b/repo-settings.c
@@ -26,7 +26,7 @@ void prepare_repo_settings(struct repository *r)
/* Defaults */
r->settings.index_version = -1;
r->settings.core_untracked_cache = UNTRACKED_CACHE_KEEP;
- r->settings.fetch_negotiation_algorithm = FETCH_NEGOTIATION_DEFAULT;
+ r->settings.fetch_negotiation_algorithm = FETCH_NEGOTIATION_CONSECUTIVE;
/* Booleans config or default, cascades to other settings */
repo_cfg_bool(r, "feature.manyfiles", &manyfiles, 0);
@@ -81,10 +81,17 @@ void prepare_repo_settings(struct repository *r)
}
if (!repo_config_get_string(r, "fetch.negotiationalgorithm", &strval)) {
+ int fetch_default = r->settings.fetch_negotiation_algorithm;
if (!strcasecmp(strval, "skipping"))
r->settings.fetch_negotiation_algorithm = FETCH_NEGOTIATION_SKIPPING;
else if (!strcasecmp(strval, "noop"))
r->settings.fetch_negotiation_algorithm = FETCH_NEGOTIATION_NOOP;
+ else if (!strcasecmp(strval, "consecutive"))
+ r->settings.fetch_negotiation_algorithm = FETCH_NEGOTIATION_CONSECUTIVE;
+ else if (!strcasecmp(strval, "default"))
+ r->settings.fetch_negotiation_algorithm = fetch_default;
+ else
+ die("unknown fetch negotiation algorithm '%s'", strval);
}
/*