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:
Jonathan Tan
2021-06-17 10:13:23 -07:00
committed by Junio C Hamano
parent ebaf3bcf1a
commit ef7dc2e9cc
4 changed files with 82 additions and 46 deletions

View File

@@ -10,6 +10,7 @@ struct lock_file;
struct pathspec;
struct raw_object_store;
struct submodule_cache;
struct promisor_remote_config;
enum untracked_cache_setting {
UNTRACKED_CACHE_UNSET = -1,
@@ -141,6 +142,7 @@ struct repository {
/* Configurations related to promisor remotes. */
char *repository_format_partial_clone;
struct promisor_remote_config *promisor_remote_config;
/* Configurations */