]> git.99rst.org Git - git.git/commit
replay: die when --onto does not peel to a commit
authorJohannes Schindelin <redacted>
Fri, 10 Jul 2026 11:39:31 +0000 (11:39 +0000)
committerJunio C Hamano <redacted>
Fri, 10 Jul 2026 15:13:54 +0000 (08:13 -0700)
commite87d701dc69a6b194f223f2405102cae4c4af03b
treef9880315614b134f46bc8f35ad85a45c31f5b15f
parent74fb18824cda5f28811e5d5e4653434f01238133
replay: die when --onto does not peel to a commit

The `peel_committish()` function calls `repo_peel_to_type()` to convert
the given object to a commit, but does not check the return value. When
the object exists but cannot be peeled to a commit (e.g., a tree or blob
OID is passed as --onto), the return value is NULL. Add an explicit NULL
check and die with a descriptive message in that case.

Pointed out by Coverity.

Assisted-by: Claude Opus 4.6
Signed-off-by: Johannes Schindelin <redacted>
Signed-off-by: Junio C Hamano <redacted>
replay.c
git clone https://git.99rst.org/PROJECT