blob: 273390229fe4c442915e911b421339e2391fc37c [file] [log] [blame]
Jonathan Tanec062832018-06-14 15:54:28 -07001#include "git-compat-util.h"
2#include "fetch-negotiator.h"
3#include "negotiator/default.h"
Jonathan Tan42cc7482018-07-16 11:44:01 -07004#include "negotiator/skipping.h"
Jonathan Tancbe566a2020-08-17 21:01:31 -07005#include "negotiator/noop.h"
Derrick Stoleeaaf633c2019-08-13 11:37:48 -07006#include "repository.h"
Jonathan Tanec062832018-06-14 15:54:28 -07007
Derrick Stoleeaaf633c2019-08-13 11:37:48 -07008void fetch_negotiator_init(struct repository *r,
9 struct fetch_negotiator *negotiator)
Jonathan Tanec062832018-06-14 15:54:28 -070010{
Derrick Stoleeaaf633c2019-08-13 11:37:48 -070011 prepare_repo_settings(r);
12 switch(r->settings.fetch_negotiation_algorithm) {
13 case FETCH_NEGOTIATION_SKIPPING:
14 skipping_negotiator_init(negotiator);
15 return;
16
Jonathan Tancbe566a2020-08-17 21:01:31 -070017 case FETCH_NEGOTIATION_NOOP:
18 noop_negotiator_init(negotiator);
19 return;
20
Derrick Stoleeaaf633c2019-08-13 11:37:48 -070021 case FETCH_NEGOTIATION_DEFAULT:
Derrick Stoleeaaf633c2019-08-13 11:37:48 -070022 default_negotiator_init(negotiator);
23 return;
Jonathan Tan42cc7482018-07-16 11:44:01 -070024 }
Jonathan Tanec062832018-06-14 15:54:28 -070025}