]> git.ipfire.org Git - thirdparty/git.git/blobdiff - builtin/grep.c
Merge branch 'eb/hash-transition'
[thirdparty/git.git] / builtin / grep.c
index 982bcfc4b1dfb81d35c2af2bf6118f289ec376ef..5777ba82a988e8a26dcae2e77ab8fb3423b70a6f 100644 (file)
@@ -527,7 +527,7 @@ static int grep_submodule(struct grep_opt *opt,
                strbuf_addstr(&base, filename);
                strbuf_addch(&base, '/');
 
-               init_tree_desc(&tree, data, size);
+               init_tree_desc(&tree, oid, data, size);
                hit = grep_tree(&subopt, pathspec, &tree, &base, base.len,
                                object_type == OBJ_COMMIT);
                strbuf_release(&base);
@@ -573,7 +573,7 @@ static int grep_cache(struct grep_opt *opt,
                                                     &type, &size);
                        if (!data)
                                die(_("unable to read tree %s"), oid_to_hex(&ce->oid));
-                       init_tree_desc(&tree, data, size);
+                       init_tree_desc(&tree, &ce->oid, data, size);
 
                        hit |= grep_tree(opt, pathspec, &tree, &name, 0, 0);
                        strbuf_setlen(&name, name_base_len);
@@ -669,7 +669,7 @@ static int grep_tree(struct grep_opt *opt, const struct pathspec *pathspec,
                                    oid_to_hex(&entry.oid));
 
                        strbuf_addch(base, '/');
-                       init_tree_desc(&sub, data, size);
+                       init_tree_desc(&sub, &entry.oid, data, size);
                        hit |= grep_tree(opt, pathspec, &sub, base, tn_len,
                                         check_attr);
                        free(data);
@@ -713,7 +713,7 @@ static int grep_object(struct grep_opt *opt, const struct pathspec *pathspec,
                        strbuf_add(&base, name, len);
                        strbuf_addch(&base, ':');
                }
-               init_tree_desc(&tree, data, size);
+               init_tree_desc(&tree, &obj->oid, data, size);
                hit = grep_tree(opt, pathspec, &tree, &base, base.len,
                                obj->type == OBJ_COMMIT);
                strbuf_release(&base);