summaryrefslogtreecommitdiff
path: root/repo-settings.c
diff options
context:
space:
mode:
authorElijah Newren <newren@gmail.com>2022-02-02 03:42:39 (GMT)
committerJunio C Hamano <gitster@pobox.com>2022-02-02 17:36:17 (GMT)
commita9a136c23223bf6b211db0746f3c9f6769deb833 (patch)
tree89735a7fec36cc0c2177c98b6886b66250c86209 /repo-settings.c
parenta68c5b9eba0e62af19a84e1f8945fcdef06c96d1 (diff)
downloadgit-a9a136c23223bf6b211db0746f3c9f6769deb833.zip
git-a9a136c23223bf6b211db0746f3c9f6769deb833.tar.gz
git-a9a136c23223bf6b211db0746f3c9f6769deb833.tar.bz2
repo-settings: fix error handling for unknown values
In commit af3a67de01 ("negotiator: unknown fetch.negotiationAlgorithm should error out", 2018-08-01), error handling for an unknown fetch.negotiationAlgorithm was added with the code die()ing. This was also added to the documentation for the fetch.negotiationAlgorithm option, to make it explicit that the code would die on unknown values. This behavior was lost with commit aaf633c2ad ("repo-settings: create feature.experimental setting", 2019-08-13). Restore it so that the behavior again matches the documentation. 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.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/repo-settings.c b/repo-settings.c
index 27f2306..ab896fa 100644
--- a/repo-settings.c
+++ b/repo-settings.c
@@ -84,6 +84,8 @@ void prepare_repo_settings(struct repository *r)
r->settings.fetch_negotiation_algorithm = FETCH_NEGOTIATION_NOOP;
else if (!strcasecmp(strval, "default"))
r->settings.fetch_negotiation_algorithm = FETCH_NEGOTIATION_DEFAULT;
+ else
+ die("unknown fetch negotiation algorithm '%s'", strval);
}
/*