fetch-negotiator.c 545 Bytes
Newer Older
1 2 3
#include "git-compat-util.h"
#include "fetch-negotiator.h"
#include "negotiator/default.h"
4
#include "negotiator/skipping.h"
5

6 7
void fetch_negotiator_init(struct fetch_negotiator *negotiator,
			   const char *algorithm)
8
{
9 10 11 12 13 14 15 16 17
	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);
		}
18
	}
19 20
	default_negotiator_init(negotiator);
}