]> git.ipfire.org Git - thirdparty/git.git/blobdiff - builtin/grep.c
Merge branch 'bc/object-id'
[thirdparty/git.git] / builtin / grep.c
index 749e346f4907abca7e9803248e236f9517c4e430..4229cae390ddddcc74f3506dc892ed02b45d7eae 100644 (file)
@@ -459,7 +459,7 @@ static int grep_object(struct grep_opt *opt, const struct pathspec *pathspec,
                       struct object *obj, const char *name, const char *path)
 {
        if (obj->type == OBJ_BLOB)
-               return grep_sha1(opt, obj->sha1, name, 0, path);
+               return grep_sha1(opt, obj->oid.hash, name, 0, path);
        if (obj->type == OBJ_COMMIT || obj->type == OBJ_TREE) {
                struct tree_desc tree;
                void *data;
@@ -468,12 +468,12 @@ static int grep_object(struct grep_opt *opt, const struct pathspec *pathspec,
                int hit, len;
 
                grep_read_lock();
-               data = read_object_with_reference(obj->sha1, tree_type,
+               data = read_object_with_reference(obj->oid.hash, tree_type,
                                                  &size, NULL);
                grep_read_unlock();
 
                if (!data)
-                       die(_("unable to read tree (%s)"), sha1_to_hex(obj->sha1));
+                       die(_("unable to read tree (%s)"), oid_to_hex(&obj->oid));
 
                len = name ? strlen(name) : 0;
                strbuf_init(&base, PATH_MAX + len + 1);