mirror of
https://github.com/git/git.git
synced 2026-01-11 13:23:12 +09:00
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>
This commit is contained in:
parent
f67f7ddbbd
commit
6f693364cc
@ -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);
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user