2019-06-25 21:40:27 +08:00
|
|
|
#ifndef PROMISOR_REMOTE_H
|
|
|
|
#define PROMISOR_REMOTE_H
|
|
|
|
|
2019-09-25 16:20:56 +08:00
|
|
|
#include "repository.h"
|
|
|
|
|
2019-06-25 21:40:28 +08:00
|
|
|
struct object_id;
|
|
|
|
|
2019-06-25 21:40:27 +08:00
|
|
|
/*
|
|
|
|
* Promisor remote linked list
|
2019-06-25 21:40:32 +08:00
|
|
|
*
|
|
|
|
* Information in its fields come from remote.XXX config entries or
|
2020-09-22 11:03:56 +08:00
|
|
|
* from extensions.partialclone.
|
2019-06-25 21:40:27 +08:00
|
|
|
*/
|
|
|
|
struct promisor_remote {
|
|
|
|
struct promisor_remote *next;
|
2019-06-25 21:40:32 +08:00
|
|
|
const char *partial_clone_filter;
|
2019-06-25 21:40:27 +08:00
|
|
|
const char name[FLEX_ARRAY];
|
|
|
|
};
|
|
|
|
|
2021-06-18 01:13:23 +08:00
|
|
|
void repo_promisor_remote_reinit(struct repository *r);
|
|
|
|
static inline void promisor_remote_reinit(void)
|
|
|
|
{
|
|
|
|
repo_promisor_remote_reinit(the_repository);
|
|
|
|
}
|
|
|
|
|
|
|
|
void promisor_remote_clear(struct promisor_remote_config *config);
|
|
|
|
|
|
|
|
struct promisor_remote *repo_promisor_remote_find(struct repository *r, const char *remote_name);
|
|
|
|
static inline struct promisor_remote *promisor_remote_find(const char *remote_name)
|
|
|
|
{
|
|
|
|
return repo_promisor_remote_find(the_repository, remote_name);
|
|
|
|
}
|
|
|
|
|
|
|
|
int repo_has_promisor_remote(struct repository *r);
|
|
|
|
static inline int has_promisor_remote(void)
|
|
|
|
{
|
|
|
|
return repo_has_promisor_remote(the_repository);
|
|
|
|
}
|
2020-04-03 03:19:16 +08:00
|
|
|
|
|
|
|
/*
|
|
|
|
* Fetches all requested objects from all promisor remotes, trying them one at
|
2022-10-05 05:13:40 +08:00
|
|
|
* a time until all objects are fetched.
|
2020-04-03 03:19:16 +08:00
|
|
|
*
|
2022-10-05 05:13:40 +08:00
|
|
|
* If oid_nr is 0, this function returns immediately.
|
2020-04-03 03:19:16 +08:00
|
|
|
*/
|
2022-10-05 05:13:40 +08:00
|
|
|
void promisor_remote_get_direct(struct repository *repo,
|
|
|
|
const struct object_id *oids,
|
|
|
|
int oid_nr);
|
2019-06-25 21:40:27 +08:00
|
|
|
|
|
|
|
#endif /* PROMISOR_REMOTE_H */
|