diff options
Diffstat (limited to 'reset.c')
-rw-r--r-- | reset.c | 5 |
1 files changed, 5 insertions, 0 deletions
@@ -157,6 +157,11 @@ int reset_head(struct repository *r, const struct reset_head_opts *opts) } tree = parse_tree_indirect(oid); + if (!tree) { + ret = error(_("unable to read tree (%s)"), oid_to_hex(oid)); + goto leave_reset_head; + } + prime_cache_tree(r, r->index, tree); if (write_locked_index(r->index, &lock, COMMIT_LOCK) < 0) { |