diff options
author | Elijah Newren <newren@gmail.com> | 2022-02-02 03:42:40 (GMT) |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2022-02-02 17:36:17 (GMT) |
commit | 714edc620c7ddca5d54ff148ac27da6b67217012 (patch) | |
tree | dfd2d301d4bca044f1843b087a5a20883a6e2dcd /repo-settings.c | |
parent | a9a136c23223bf6b211db0746f3c9f6769deb833 (diff) | |
download | git-714edc620c7ddca5d54ff148ac27da6b67217012.zip git-714edc620c7ddca5d54ff148ac27da6b67217012.tar.gz git-714edc620c7ddca5d54ff148ac27da6b67217012.tar.bz2 |
repo-settings: rename the traditional default fetch.negotiationAlgorithm
Give the traditional default fetch.negotiationAlgorithm the name
'consecutive'. Also allow a choice of 'default' to have Git decide
between the choices (currently, picking 'skipping' if
feature.experimental is true and 'consecutive' otherwise). Update the
documentation accordingly.
Signed-off-by: Elijah Newren <newren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'repo-settings.c')
-rw-r--r-- | repo-settings.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/repo-settings.c b/repo-settings.c index ab896fa..c9ca1fd 100644 --- a/repo-settings.c +++ b/repo-settings.c @@ -23,7 +23,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); @@ -78,12 +78,15 @@ 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_NEGOTIATION_DEFAULT; + r->settings.fetch_negotiation_algorithm = fetch_default; else die("unknown fetch negotiation algorithm '%s'", strval); } |