path: root/builtin/grep.c
diff options
authorStefan Beller <>2018-03-23 17:20:55 (GMT)
committerJunio C Hamano <>2018-03-23 18:06:01 (GMT)
commit90c62155d65a6bec5c2c293c8ece0b22173f63a3 (patch)
treec4d23c9cae65059849f5e1d39814f3eb34657120 /builtin/grep.c
parent00a3da2a131a3e122df7e053d992fbc1735bf4f9 (diff)
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 <> Signed-off-by: Jonathan Nieder <> Signed-off-by: Nguyễn Thái Ngọc Duy <> Signed-off-by: Junio C Hamano <>
Diffstat (limited to 'builtin/grep.c')
1 files changed, 2 insertions, 1 deletions
diff --git a/builtin/grep.c b/builtin/grep.c
index 3ca4ac8..1e9cdbd 100644
--- a/builtin/grep.c
+++ b/builtin/grep.c
@@ -22,6 +22,7 @@
#include "pathspec.h"
#include "submodule.h"
#include "submodule-config.h"
+#include "object-store.h"
static char const * const grep_usage[] = {
N_("git grep [<options>] [-e] <pattern> [<rev>...] [[--] <path>...]"),
@@ -432,7 +433,7 @@ static int grep_submodule(struct grep_opt *opt, struct repository *superproject,
* object.
- add_to_alternates_memory(submodule.objectdir);
+ add_to_alternates_memory(submodule.objects->objectdir);
if (oid) {