]> git.ipfire.org Git - thirdparty/git.git/commit
commit-reach: die on contains walk errors
authorTamir Duberstein <tamird@gmail.com>
Fri, 12 Jun 2026 21:49:14 +0000 (17:49 -0400)
committerJunio C Hamano <gitster@pobox.com>
Fri, 12 Jun 2026 22:56:44 +0000 (15:56 -0700)
commitff3ba7d158765f02effa417feca0a7e0089116c4
tree6164e204ba95c9de6a0b5c363b2365c6e85bb6ec
parentca96eeee79bc231f8096d9e9d0b501e0495e2db7
commit-reach: die on contains walk errors

Without generation numbers, repo_is_descendant_of() can return -1 when
it cannot read commit ancestry. commit_contains() exposes that result
through a Boolean interface, so ref-filter treats it as true. This can
include a ref for --contains or exclude it for --no-contains without
failing the command.

Die when repo_is_descendant_of() reports an error. The memoized walk
already dies when it cannot parse a commit, so callers of the
non-memoized path no longer turn a failed walk into a match.

Reported-by: Jeff King <peff@peff.net>
Signed-off-by: Tamir Duberstein <tamird@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
commit-reach.c
t/t6301-for-each-ref-errors.sh