Merge branch 'nd/tree-walk-with-repo'
[gitweb.git] / builtin / grep.c
index 580fd38f41704b6d534c04f2dee1bf85eee67c3c..560051784ef7c222046d51ba8b8bf7f84223a26e 100644 (file)
@@ -458,7 +458,8 @@ static int grep_submodule(struct grep_opt *opt,
                object = parse_object_or_die(oid, oid_to_hex(oid));
 
                grep_read_lock();
-               data = read_object_with_reference(&object->oid, tree_type,
+               data = read_object_with_reference(&subrepo,
+                                                 &object->oid, tree_type,
                                                  &size, NULL);
                grep_read_unlock();
 
@@ -623,7 +624,8 @@ static int grep_object(struct grep_opt *opt, const struct pathspec *pathspec,
                int hit, len;
 
                grep_read_lock();
-               data = read_object_with_reference(&obj->oid, tree_type,
+               data = read_object_with_reference(opt->repo,
+                                                 &obj->oid, tree_type,
                                                  &size, NULL);
                grep_read_unlock();