]> git.ipfire.org Git - thirdparty/git.git/commit
commit-reach(paint_down_to_common): start reporting errors
authorJohannes Schindelin <johannes.schindelin@gmx.de>
Wed, 28 Feb 2024 09:44:11 +0000 (09:44 +0000)
committerJunio C Hamano <gitster@pobox.com>
Thu, 29 Feb 2024 16:06:01 +0000 (08:06 -0800)
commit896a0e11f37687fb3d40c0aa2b28062264232823
treed5d22bcfa5e701befbe92fb78d8f48a3e194ebe2
parent2d2da172f37f5a406a0f5a099cd268bcb1bd7d42
commit-reach(paint_down_to_common): start reporting errors

If a commit cannot be parsed, it is currently ignored when looking for
merge bases. That's undesirable as the operation can pretend success in
a corrupt repository, even though the command should fail with an error
message.

Let's start at the bottom of the stack by teaching the
`paint_down_to_common()` function to return an `int`: if negative, it
indicates fatal error, if 0 success.

This requires a couple of callers to be adjusted accordingly.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
commit-reach.c