summaryrefslogtreecommitdiff
path: root/repository.c
diff options
context:
space:
mode:
Diffstat (limited to 'repository.c')
-rw-r--r--repository.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/repository.c b/repository.c
index c5b90ba93e..34610c5a33 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);
@@ -80,6 +82,8 @@ void repo_set_gitdir(struct repository *repo,
expand_base_dir(&repo->objects->odb->path, o->object_dir,
repo->commondir, "objects");
+ repo->objects->odb->disable_ref_updates = o->disable_ref_updates;
+
free(repo->objects->alternate_db);
repo->objects->alternate_db = xstrdup_or_null(o->alternate_db);
expand_base_dir(&repo->graft_file, o->graft_file,
@@ -164,6 +168,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 +275,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)