summaryrefslogtreecommitdiff
path: root/repository.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2018-06-25 20:22:38 (GMT)
committerJunio C Hamano <gitster@pobox.com>2018-06-25 20:22:38 (GMT)
commit110240588d5c0ca88d3b55da52068f59d8d6367d (patch)
tree5a9120c2c70aeb9d2e7ac4347870094870019e49 /repository.c
parentfa82bb70d9ef3acb6a47cddfb38a7b0ca40ac362 (diff)
parent14ba97f81c7b94e10d591b363688a073023f332d (diff)
downloadgit-110240588d5c0ca88d3b55da52068f59d8d6367d.zip
git-110240588d5c0ca88d3b55da52068f59d8d6367d.tar.gz
git-110240588d5c0ca88d3b55da52068f59d8d6367d.tar.bz2
Merge branch 'sb/object-store-alloc'
The conversion to pass "the_repository" and then "a_repository" throughout the object access API continues. * sb/object-store-alloc: alloc: allow arbitrary repositories for alloc functions object: allow create_object to handle arbitrary repositories object: allow grow_object_hash to handle arbitrary repositories alloc: add repository argument to alloc_commit_index alloc: add repository argument to alloc_report alloc: add repository argument to alloc_object_node alloc: add repository argument to alloc_tag_node alloc: add repository argument to alloc_commit_node alloc: add repository argument to alloc_tree_node alloc: add repository argument to alloc_blob_node object: add repository argument to grow_object_hash object: add repository argument to create_object repository: introduce parsed objects field
Diffstat (limited to 'repository.c')
-rw-r--r--repository.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/repository.c b/repository.c
index 02fe884..5dd1486 100644
--- a/repository.c
+++ b/repository.c
@@ -2,6 +2,7 @@
#include "repository.h"
#include "object-store.h"
#include "config.h"
+#include "object.h"
#include "submodule-config.h"
/* The main repository */
@@ -14,6 +15,8 @@ void initialize_the_repository(void)
the_repo.index = &the_index;
the_repo.objects = raw_object_store_new();
+ the_repo.parsed_objects = parsed_object_pool_new();
+
repo_set_hash_algo(&the_repo, GIT_HASH_SHA1);
}
@@ -143,6 +146,7 @@ int repo_init(struct repository *repo,
memset(repo, 0, sizeof(*repo));
repo->objects = raw_object_store_new();
+ repo->parsed_objects = parsed_object_pool_new();
if (repo_init_gitdir(repo, gitdir))
goto error;
@@ -226,6 +230,9 @@ void repo_clear(struct repository *repo)
raw_object_store_clear(repo->objects);
FREE_AND_NULL(repo->objects);
+ parsed_object_pool_clear(repo->parsed_objects);
+ FREE_AND_NULL(repo->parsed_objects);
+
if (repo->config) {
git_configset_clear(repo->config);
FREE_AND_NULL(repo->config);