blob: 0a1357dc9d55b34992ff5a6f65e3bdf77375465e [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"
Derrick Stoleeaaf633c2019-08-13 11:37:48 -07005#include "repository.h"
Jonathan Tanec062832018-06-14 15:54:28 -07006
Derrick Stoleeaaf633c2019-08-13 11:37:48 -07007void fetch_negotiator_init(struct repository *r,
8 struct fetch_negotiator *negotiator)
Jonathan Tanec062832018-06-14 15:54:28 -07009{
Derrick Stoleeaaf633c2019-08-13 11:37:48 -070010 prepare_repo_settings(r);
11 switch(r->settings.fetch_negotiation_algorithm) {
12 case FETCH_NEGOTIATION_SKIPPING:
13 skipping_negotiator_init(negotiator);
14 return;
15
16 case FETCH_NEGOTIATION_DEFAULT:
17 default:
18 default_negotiator_init(negotiator);
19 return;
Jonathan Tan42cc7482018-07-16 11:44:01 -070020 }
Jonathan Tanec062832018-06-14 15:54:28 -070021}