summaryrefslogtreecommitdiff
path: root/repository.c
diff options
context:
space:
mode:
authorBrandon Williams <bmwill@google.com>2017-06-22 18:43:44 (GMT)
committerJunio C Hamano <gitster@pobox.com>2017-06-24 01:24:34 (GMT)
commitbf12fcdf5ec00e6b7d0978750df9e0146eb57c75 (patch)
tree5b71651780a3f276212c35f05e67c8a8c5c3358c /repository.c
parent639e30b5b2214c68c042215a279ac1fbb372d73d (diff)
downloadgit-bf12fcdf5ec00e6b7d0978750df9e0146eb57c75.zip
git-bf12fcdf5ec00e6b7d0978750df9e0146eb57c75.tar.gz
git-bf12fcdf5ec00e6b7d0978750df9e0146eb57c75.tar.bz2
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 <bmwill@google.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 6f6f4d9..358c175 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);