diff options
Diffstat (limited to 'builtin/reset.c')
| -rw-r--r-- | builtin/reset.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/builtin/reset.c b/builtin/reset.c index 4b018d20e3..fd36fc5bd9 100644 --- a/builtin/reset.c +++ b/builtin/reset.c @@ -119,6 +119,10 @@ static int reset_index(const char *ref, const struct object_id *oid, int reset_t if (reset_type == MIXED || reset_type == HARD) { tree = parse_tree_indirect(oid); + if (!tree) { + error(_("unable to read tree (%s)"), oid_to_hex(oid)); + goto out; + } prime_cache_tree(the_repository, the_repository->index, tree); } |
