]> git.ipfire.org Git - thirdparty/git.git/commit - commit-reach.c
commit-reach(merge_bases_many): pass on "missing commits" errors
authorJohannes Schindelin <johannes.schindelin@gmx.de>
Wed, 28 Feb 2024 09:44:12 +0000 (09:44 +0000)
committerJunio C Hamano <gitster@pobox.com>
Thu, 29 Feb 2024 16:06:01 +0000 (08:06 -0800)
commitfb02c523a317937a4080315c2d8f8151730b87be
tree1096c3bf219fdd566ca9db66892c6353a14556bf
parent896a0e11f37687fb3d40c0aa2b28062264232823
commit-reach(merge_bases_many): pass on "missing commits" errors

The `paint_down_to_common()` function was just taught to indicate
parsing errors, and now the `merge_bases_many()` function is aware of
that, too.

One tricky aspect is that `merge_bases_many()` parses commits of its
own, but wants to gracefully handle the scenario where NULL is passed as
a merge head, returning the empty list of merge bases. The way this was
handled involved calling `repo_parse_commit(NULL)` and relying on it to
return an error. This has to be done differently now so that we can
handle missing commits correctly by producing a fatal error.

Next step: adjust the caller of `merge_bases_many()`:
`get_merge_bases_many_0()`.

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