aboutsummaryrefslogtreecommitdiffstats
path: root/fetch-negotiator.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2018-08-17 13:09:55 -0700
committerJunio C Hamano <gitster@pobox.com>2018-08-17 13:09:55 -0700
commit28dbabb5e04d0d2bc714c46f24dfbf102089c15b (patch)
tree8aeebb44d9d14177a512e7b73532bb00865c3362 /fetch-negotiator.c
parentMerge branch 'jt/refspec-dwim-precedence-fix' (diff)
parentfetch doc: cross-link two new negotiation options (diff)
downloadgit-28dbabb5e04d0d2bc714c46f24dfbf102089c15b.tar.gz
git-28dbabb5e04d0d2bc714c46f24dfbf102089c15b.zip
Merge branch 'ab/fetch-nego'
Update to a few other topics around 'git fetch'. * ab/fetch-nego: fetch doc: cross-link two new negotiation options negotiator: unknown fetch.negotiationAlgorithm should error out
Diffstat (limited to 'fetch-negotiator.c')
-rw-r--r--fetch-negotiator.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/fetch-negotiator.c b/fetch-negotiator.c
index 5d283049f4..d6d685cba0 100644
--- a/fetch-negotiator.c
+++ b/fetch-negotiator.c
@@ -6,9 +6,15 @@
void fetch_negotiator_init(struct fetch_negotiator *negotiator,
const char *algorithm)
{
- if (algorithm && !strcmp(algorithm, "skipping")) {
- skipping_negotiator_init(negotiator);
- return;
+ if (algorithm) {
+ if (!strcmp(algorithm, "skipping")) {
+ skipping_negotiator_init(negotiator);
+ return;
+ } else if (!strcmp(algorithm, "default")) {
+ /* Fall through to default initialization */
+ } else {
+ die("unknown fetch negotiation algorithm '%s'", algorithm);
+ }
}
default_negotiator_init(negotiator);
}