]> git.ipfire.org Git - thirdparty/git.git/blobdiff - builtin/grep.c
object-name.h: move declarations for object-name.c functions from cache.h
[thirdparty/git.git] / builtin / grep.c
index f7821c5fbbaeda3888f3011ee5215393e1319952..f66e14389e145eb0b292d5a7ab45bf8137e8eb1a 100644 (file)
@@ -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"
 #include "quote.h"
 #include "dir.h"
 #include "pathspec.h"
+#include "setup.h"
 #include "submodule.h"
 #include "submodule-config.h"
+#include "object-name.h"
 #include "object-store.h"
 #include "packfile.h"
+#include "write-or-die.h"
 
 static const char *grep_prefix;
 
@@ -560,7 +566,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 +657,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));