aboutsummaryrefslogtreecommitdiffstats
path: root/environment.c
diff options
context:
space:
mode:
authorStefan Beller <sbeller@google.com>2018-03-23 18:20:55 +0100
committerJunio C Hamano <gitster@pobox.com>2018-03-23 11:06:01 -0700
commit90c62155d65a6bec5c2c293c8ece0b22173f63a3 (patch)
treec4d23c9cae65059849f5e1d39814f3eb34657120 /environment.c
parent00a3da2a131a3e122df7e053d992fbc1735bf4f9 (diff)
downloadgit-90c62155d65a6bec5c2c293c8ece0b22173f63a3.tar.gz
repository: introduce raw object store field
The raw object store field will contain any objects needed for access to objects in a given repository. This patch introduces the raw object store and populates it with the `objectdir`, which used to be part of the repository struct. As the struct gains members, we'll also populate the function to clear the memory for these members. In a later step, we'll introduce a struct object_parser, that will complement the object parsing in a repository struct: The raw object parser is the layer that will provide access to raw object content, while the higher level object parser code will parse raw objects and keeps track of parenthood and other object relationships using 'struct object'. For now only add the lower level to the repository struct. Signed-off-by: Stefan Beller <sbeller@google.com> Signed-off-by: Jonathan Nieder <jrnieder@gmail.com> Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'environment.c')
-rw-r--r--environment.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/environment.c b/environment.c
index a5eaa97fb1..93c9fbb0ba 100644
--- a/environment.c
+++ b/environment.c
@@ -14,6 +14,7 @@
#include "fmt-merge-msg.h"
#include "commit.h"
#include "argv-array.h"
+#include "object-store.h"
int trust_executable_bit = 1;
int trust_ctime = 1;
@@ -270,9 +271,9 @@ const char *get_git_work_tree(void)
char *get_object_directory(void)
{
- if (!the_repository->objectdir)
+ if (!the_repository->objects->objectdir)
BUG("git environment hasn't been setup");
- return the_repository->objectdir;
+ return the_repository->objects->objectdir;
}
int odb_mkstemp(struct strbuf *template, const char *pattern)