diff options
Diffstat (limited to 'builtin/grep.c')
| -rw-r--r-- | builtin/grep.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/builtin/grep.c b/builtin/grep.c index fe78d4c98b..982bcfc4b1 100644 --- a/builtin/grep.c +++ b/builtin/grep.c @@ -9,15 +9,11 @@ #include "hex.h" #include "repository.h" #include "config.h" -#include "blob.h" -#include "tree.h" -#include "commit.h" #include "tag.h" #include "tree-walk.h" #include "parse-options.h" #include "string-list.h" #include "run-command.h" -#include "userdiff.h" #include "grep.h" #include "quote.h" #include "dir.h" @@ -575,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); |
