]> git.ipfire.org Git - thirdparty/git.git/blobdiff - builtin/grep.c
Merge branch 'js/check-null-from-read-object-file'
[thirdparty/git.git] / builtin / grep.c
index c8e33f977552081fcde8afc12d0aa92bfc4b5e62..982bcfc4b1dfb81d35c2af2bf6118f289ec376ef 100644 (file)
@@ -571,6 +571,8 @@ static int grep_cache(struct grep_opt *opt,
 
                        data = repo_read_object_file(the_repository, &ce->oid,
                                                     &type, &size);
+                       if (!data)
+                               die(_("unable to read tree %s"), oid_to_hex(&ce->oid));
                        init_tree_desc(&tree, data, size);
 
                        hit |= grep_tree(opt, pathspec, &tree, &name, 0, 0);