mirror of
https://github.com/git/git.git
synced 2025-12-12 20:36:24 +01:00
promisor-remote: support per-repository config
Instead of using global variables to store promisor remote information, store this config in struct repository instead, and add repository-agnostic non-static functions corresponding to the existing non-static functions that only work on the_repository. The actual lazy-fetching of missing objects currently does not work on repositories other than the_repository, and will still not work after this commit, so add a BUG message explaining this. A subsequent commit will remove this limitation. Signed-off-by: Jonathan Tan <jonathantanmy@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com> Reviewed-by: Elijah Newren <newren@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
committed by
Junio C Hamano
parent
ebaf3bcf1a
commit
ef7dc2e9cc
@@ -17,9 +17,25 @@ struct promisor_remote {
|
||||
const char name[FLEX_ARRAY];
|
||||
};
|
||||
|
||||
void promisor_remote_reinit(void);
|
||||
struct promisor_remote *promisor_remote_find(const char *remote_name);
|
||||
int has_promisor_remote(void);
|
||||
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);
|
||||
}
|
||||
|
||||
/*
|
||||
* Fetches all requested objects from all promisor remotes, trying them one at
|
||||
|
||||
Reference in New Issue
Block a user