Jonathan Tan | ec06283 | 2018-06-14 15:54:28 -0700 | [diff] [blame] | 1 | #include "git-compat-util.h" |
| 2 | #include "fetch-negotiator.h" |
| 3 | #include "negotiator/default.h" |
Jonathan Tan | 42cc748 | 2018-07-16 11:44:01 -0700 | [diff] [blame] | 4 | #include "negotiator/skipping.h" |
Jonathan Tan | cbe566a | 2020-08-17 21:01:31 -0700 | [diff] [blame] | 5 | #include "negotiator/noop.h" |
Derrick Stolee | aaf633c | 2019-08-13 11:37:48 -0700 | [diff] [blame] | 6 | #include "repository.h" |
Jonathan Tan | ec06283 | 2018-06-14 15:54:28 -0700 | [diff] [blame] | 7 | |
Derrick Stolee | aaf633c | 2019-08-13 11:37:48 -0700 | [diff] [blame] | 8 | void fetch_negotiator_init(struct repository *r, |
| 9 | struct fetch_negotiator *negotiator) |
Jonathan Tan | ec06283 | 2018-06-14 15:54:28 -0700 | [diff] [blame] | 10 | { |
Derrick Stolee | aaf633c | 2019-08-13 11:37:48 -0700 | [diff] [blame] | 11 | 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 Tan | cbe566a | 2020-08-17 21:01:31 -0700 | [diff] [blame] | 17 | case FETCH_NEGOTIATION_NOOP: |
| 18 | noop_negotiator_init(negotiator); |
| 19 | return; |
| 20 | |
Elijah Newren | 714edc6 | 2022-02-02 03:42:40 +0000 | [diff] [blame] | 21 | case FETCH_NEGOTIATION_CONSECUTIVE: |
Derrick Stolee | aaf633c | 2019-08-13 11:37:48 -0700 | [diff] [blame] | 22 | default_negotiator_init(negotiator); |
| 23 | return; |
Jonathan Tan | 42cc748 | 2018-07-16 11:44:01 -0700 | [diff] [blame] | 24 | } |
Jonathan Tan | ec06283 | 2018-06-14 15:54:28 -0700 | [diff] [blame] | 25 | } |
Robert Coup | 1836836 | 2022-03-28 14:02:05 +0000 | [diff] [blame] | 26 | |
| 27 | void fetch_negotiator_init_noop(struct fetch_negotiator *negotiator) |
| 28 | { |
| 29 | noop_negotiator_init(negotiator); |
| 30 | } |