]> git.ipfire.org Git - thirdparty/git.git/blobdiff - repository.c
refs: print error message in debug output
[thirdparty/git.git] / repository.c
index c5b90ba93ea816c62eeaf73433e65e2730827063..c7ea706c205fee1f84301668c620906ec5c06650 100644 (file)
@@ -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)