From bf12fcdf5ec00e6b7d0978750df9e0146eb57c75 Mon Sep 17 00:00:00 2001 From: Brandon Williams Date: Thu, 22 Jun 2017 11:43:44 -0700 Subject: submodule-config: store the_submodule_cache in the_repository Refactor how 'the_submodule_cache' is handled so that it can be stored inside of a repository object. Also migrate 'the_submodule_cache' to be stored in 'the_repository'. Signed-off-by: Brandon Williams Signed-off-by: Junio C Hamano --- repository.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'repository.c') diff --git a/repository.c b/repository.c index 6f6f4d91ef..358c175172 100644 --- a/repository.c +++ b/repository.c @@ -1,6 +1,7 @@ #include "cache.h" #include "repository.h" #include "config.h" +#include "submodule-config.h" /* The main repository */ static struct repository the_repo; @@ -164,6 +165,11 @@ void repo_clear(struct repository *repo) repo->config = NULL; } + if (repo->submodule_cache) { + submodule_cache_free(repo->submodule_cache); + repo->submodule_cache = NULL; + } + if (repo->index) { discard_index(repo->index); free(repo->index); -- cgit v1.2.1