The sixteenth batch
[git/gitster.git] / promisor-remote.h
blob263d331a551b6ca80daa559d43fc61f7b081967e
1 #ifndef PROMISOR_REMOTE_H
2 #define PROMISOR_REMOTE_H
4 #include "repository.h"
6 struct object_id;
8 /*
9 * Promisor remote linked list
11 * Information in its fields come from remote.XXX config entries or
12 * from extensions.partialclone, except for 'accepted' which comes
13 * from protocol v2 capabilities exchange.
15 struct promisor_remote {
16 struct promisor_remote *next;
17 char *partial_clone_filter;
18 unsigned int accepted : 1;
19 const char name[FLEX_ARRAY];
22 void repo_promisor_remote_reinit(struct repository *r);
23 void promisor_remote_clear(struct promisor_remote_config *config);
24 struct promisor_remote *repo_promisor_remote_find(struct repository *r, const char *remote_name);
25 int repo_has_promisor_remote(struct repository *r);
28 * Fetches all requested objects from all promisor remotes, trying them one at
29 * a time until all objects are fetched.
31 * If oid_nr is 0, this function returns immediately.
33 void promisor_remote_get_direct(struct repository *repo,
34 const struct object_id *oids,
35 int oid_nr);
38 * Prepare a "promisor-remote" advertisement by a server.
39 * Check the value of "promisor.advertise" and maybe the configured
40 * promisor remotes, if any, to prepare information to send in an
41 * advertisement.
42 * Return value is NULL if no promisor remote advertisement should be
43 * made. Otherwise it contains the names and urls of the advertised
44 * promisor remotes separated by ';'. See gitprotocol-v2(5).
46 char *promisor_remote_info(struct repository *repo);
49 * Prepare a reply to a "promisor-remote" advertisement from a server.
50 * Check the value of "promisor.acceptfromserver" and maybe the
51 * configured promisor remotes, if any, to prepare the reply.
52 * Return value is NULL if no promisor remote from the server
53 * is accepted. Otherwise it contains the names of the accepted promisor
54 * remotes separated by ';'. See gitprotocol-v2(5).
56 char *promisor_remote_reply(const char *info);
59 * Set the 'accepted' flag for some promisor remotes. Useful on the
60 * server side when some promisor remotes have been accepted by the
61 * client.
63 void mark_promisor_remotes_as_accepted(struct repository *repo, const char *remotes);
66 * Has any promisor remote been accepted by the client?
68 int repo_has_accepted_promisor_remote(struct repository *r);
70 #endif /* PROMISOR_REMOTE_H */