summaryrefslogtreecommitdiff
path: root/builtin/grep.c
diff options
context:
space:
mode:
Diffstat (limited to 'builtin/grep.c')
-rw-r--r--builtin/grep.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/builtin/grep.c b/builtin/grep.c
index f7821c5fbb..b86c754def 100644
--- a/builtin/grep.c
+++ b/builtin/grep.c
@@ -4,6 +4,9 @@
* Copyright (c) 2006 Junio C Hamano
*/
#include "cache.h"
+#include "alloc.h"
+#include "gettext.h"
+#include "hex.h"
#include "repository.h"
#include "config.h"
#include "blob.h"
@@ -20,10 +23,15 @@
#include "quote.h"
#include "dir.h"
#include "pathspec.h"
+#include "setup.h"
#include "submodule.h"
#include "submodule-config.h"
+#include "object-file.h"
+#include "object-name.h"
#include "object-store.h"
#include "packfile.h"
+#include "pager.h"
+#include "write-or-die.h"
static const char *grep_prefix;
@@ -560,7 +568,8 @@ static int grep_cache(struct grep_opt *opt,
void *data;
unsigned long size;
- data = read_object_file(&ce->oid, &type, &size);
+ data = repo_read_object_file(the_repository, &ce->oid,
+ &type, &size);
init_tree_desc(&tree, data, size);
hit |= grep_tree(opt, pathspec, &tree, &name, 0, 0);
@@ -650,7 +659,8 @@ static int grep_tree(struct grep_opt *opt, const struct pathspec *pathspec,
void *data;
unsigned long size;
- data = read_object_file(&entry.oid, &type, &size);
+ data = repo_read_object_file(the_repository,
+ &entry.oid, &type, &size);
if (!data)
die(_("unable to read tree (%s)"),
oid_to_hex(&entry.oid));