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" |
Derrick Stolee | aaf633c | 2019-08-13 11:37:48 -0700 | [diff] [blame] | 5 | #include "repository.h" |
Jonathan Tan | ec06283 | 2018-06-14 15:54:28 -0700 | [diff] [blame] | 6 | |
Derrick Stolee | aaf633c | 2019-08-13 11:37:48 -0700 | [diff] [blame] | 7 | void fetch_negotiator_init(struct repository *r, |
| 8 | struct fetch_negotiator *negotiator) |
Jonathan Tan | ec06283 | 2018-06-14 15:54:28 -0700 | [diff] [blame] | 9 | { |
Derrick Stolee | aaf633c | 2019-08-13 11:37:48 -0700 | [diff] [blame] | 10 | 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 Tan | 42cc748 | 2018-07-16 11:44:01 -0700 | [diff] [blame] | 20 | } |
Jonathan Tan | ec06283 | 2018-06-14 15:54:28 -0700 | [diff] [blame] | 21 | } |