X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=builtin%2Fgrep.c;h=a286692e467710d92346ab6900e98f1126cb967d;hb=dddc411f7abbd82f6fa7d323711b8a7b94a1abc2;hp=1c359c2671536287d97f2049b27a390d33b51e88;hpb=b43b8a20d33f6b19b088b505537133fc898048f6;p=git.git diff --git a/builtin/grep.c b/builtin/grep.c index 1c359c267..a286692e4 100644 --- a/builtin/grep.c +++ b/builtin/grep.c @@ -598,8 +598,11 @@ static int grep_object(struct grep_opt *opt, const struct pathspec *pathspec, struct strbuf base; int hit, len; + read_sha1_lock(); data = read_object_with_reference(obj->sha1, tree_type, &size, NULL); + read_sha1_unlock(); + if (!data) die(_("unable to read tree (%s)"), sha1_to_hex(obj->sha1));