summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKristoffer Haugsbakk <code@khaugsbakk.name>2026-01-05 20:53:21 +0100
committerJunio C Hamano <gitster@pobox.com>2026-01-06 07:30:16 +0900
commit6f693364cc183ea5a8296c9ce2ff515f47206f92 (patch)
tree4bf41753d30cd092b9fb196010de60779dc40c3b
parentf67f7ddbbd03634318d54b1d1ad7ed8df4a2b292 (diff)
downloadgit-6f693364cc183ea5a8296c9ce2ff515f47206f92.tar.xz
replay: die if we cannot parse object
`parse_object` can return `NULL`. That will in turn make `repo_peel_to_type` return the same. Let’s die fast and descriptively with the `*_or_die` variant. Suggested-by: Junio C Hamano <gitster@pobox.com> Signed-off-by: Kristoffer Haugsbakk <code@khaugsbakk.name> Signed-off-by: Junio C Hamano <gitster@pobox.com>
-rw-r--r--builtin/replay.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/builtin/replay.c b/builtin/replay.c
index 402db44af2..1960bbbee8 100644
--- a/builtin/replay.c
+++ b/builtin/replay.c
@@ -42,7 +42,7 @@ static struct commit *peel_committish(struct repository *repo,
if (repo_get_oid(repo, name, &oid))
die(_("'%s' is not a valid commit-ish for %s"), name, mode);
- obj = parse_object(repo, &oid);
+ obj = parse_object_or_die(repo, &oid, name);
return (struct commit *)repo_peel_to_type(repo, name, 0, obj,
OBJ_COMMIT);
}