summaryrefslogtreecommitdiff
path: root/repository.c
diff options
context:
space:
mode:
Diffstat (limited to 'repository.c')
-rw-r--r--repository.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/repository.c b/repository.c
index c5b90ba93e..c7ea706c20 100644
--- a/repository.c
+++ b/repository.c
@@ -9,6 +9,7 @@
#include "config.h"
#include "object.h"
#include "lockfile.h"
+#include "remote.h"
#include "submodule-config.h"
#include "sparse-index.h"
#include "promisor-remote.h"
@@ -24,6 +25,7 @@ void initialize_the_repository(void)
the_repo.index = &the_index;
the_repo.objects = raw_object_store_new();
+ the_repo.remote_state = remote_state_new();
the_repo.parsed_objects = parsed_object_pool_new();
repo_set_hash_algo(&the_repo, GIT_HASH_SHA1);
@@ -164,6 +166,7 @@ int repo_init(struct repository *repo,
repo->objects = raw_object_store_new();
repo->parsed_objects = parsed_object_pool_new();
+ repo->remote_state = remote_state_new();
if (repo_init_gitdir(repo, gitdir))
goto error;
@@ -270,6 +273,11 @@ void repo_clear(struct repository *repo)
promisor_remote_clear(repo->promisor_remote_config);
FREE_AND_NULL(repo->promisor_remote_config);
}
+
+ if (repo->remote_state) {
+ remote_state_clear(repo->remote_state);
+ FREE_AND_NULL(repo->remote_state);
+ }
}
int repo_read_index(struct repository *repo)