summaryrefslogtreecommitdiff
path: root/repository.c
diff options
context:
space:
mode:
authorJonathan Tan <jonathantanmy@google.com>2021-06-17 17:13:23 (GMT)
committerJunio C Hamano <gitster@pobox.com>2021-06-28 16:57:42 (GMT)
commitef7dc2e9ccb832c1dc29d5102c09f6c4a51d4dca (patch)
tree41fcf5bf22fa1ce772820e17da982e11ed1dd9b8 /repository.c
parentebaf3bcf1aecdc31062ede80fca3a7c98202d8bb (diff)
downloadgit-ef7dc2e9ccb832c1dc29d5102c09f6c4a51d4dca.zip
git-ef7dc2e9ccb832c1dc29d5102c09f6c4a51d4dca.tar.gz
git-ef7dc2e9ccb832c1dc29d5102c09f6c4a51d4dca.tar.bz2
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>
Diffstat (limited to 'repository.c')
-rw-r--r--repository.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/repository.c b/repository.c
index 057a474..b2bf44c 100644
--- a/repository.c
+++ b/repository.c
@@ -11,6 +11,7 @@
#include "lockfile.h"
#include "submodule-config.h"
#include "sparse-index.h"
+#include "promisor-remote.h"
/* The main repository */
static struct repository the_repo;
@@ -262,6 +263,11 @@ void repo_clear(struct repository *repo)
if (repo->index != &the_index)
FREE_AND_NULL(repo->index);
}
+
+ if (repo->promisor_remote_config) {
+ promisor_remote_clear(repo->promisor_remote_config);
+ FREE_AND_NULL(repo->promisor_remote_config);
+ }
}
int repo_read_index(struct repository *repo)