diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-20 05:14:36 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-20 05:14:36 +0000 |
commit | 09f61306ecfdf0e532c58460d8d868d50021e7db (patch) | |
tree | b6f46cb23ce41cddcb6e1320d5c1c4bd5d69e899 /reset.c | |
parent | Adding debian version 1:2.43.0-1. (diff) | |
download | git-09f61306ecfdf0e532c58460d8d868d50021e7db.tar.xz git-09f61306ecfdf0e532c58460d8d868d50021e7db.zip |
Merging upstream version 1:2.45.1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'reset.c')
-rw-r--r-- | reset.c | 6 |
1 files changed, 5 insertions, 1 deletions
@@ -6,7 +6,6 @@ #include "object-name.h" #include "refs.h" #include "reset.h" -#include "run-command.h" #include "tree-walk.h" #include "tree.h" #include "unpack-trees.h" @@ -158,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) { |