diff options
| author | Junio C Hamano <gitster@pobox.com> | 2024-02-14 15:36:06 -0800 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2024-02-14 15:36:06 -0800 |
| commit | c59ba68ea7d1b4614fa964403a6c662dca0dd212 (patch) | |
| tree | ba54ccb735bf678d57407f9053f179867cc038f5 /builtin/grep.c | |
| parent | e8640231883b7988f9df79fc2ba5216f03116e5c (diff) | |
| parent | 568459bf5e97a4f61429e3bdd1f97b54b39a1383 (diff) | |
| download | git-c59ba68ea7d1b4614fa964403a6c662dca0dd212.tar.gz | |
Merge branch 'js/check-null-from-read-object-file'
The code paths that call repo_read_object_file() have been
tightened to react to errors.
* js/check-null-from-read-object-file:
Always check the return value of `repo_read_object_file()`
Diffstat (limited to 'builtin/grep.c')
| -rw-r--r-- | builtin/grep.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/builtin/grep.c b/builtin/grep.c index c8e33f9775..982bcfc4b1 100644 --- a/builtin/grep.c +++ b/builtin/grep.c @@ -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); |
