diff options
author | Elijah Newren <newren@gmail.com> | 2022-02-02 04:42:40 +0100 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2022-02-02 18:36:17 +0100 |
commit | 714edc620c7ddca5d54ff148ac27da6b67217012 (patch) | |
tree | dfd2d301d4bca044f1843b087a5a20883a6e2dcd /repo-settings.c | |
parent | repo-settings: fix error handling for unknown values (diff) | |
download | git-714edc620c7ddca5d54ff148ac27da6b67217012.tar.xz git-714edc620c7ddca5d54ff148ac27da6b67217012.zip |
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 ab896fa84b..c9ca1fd427 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); } |