]> git.ipfire.org Git - thirdparty/git.git/commit
commit-reach: guard !FIND_ALL early exit with generation ordering check
authorKristofer Karlsson <krka@spotify.com>
Mon, 29 Jun 2026 13:19:21 +0000 (13:19 +0000)
committerJunio C Hamano <gitster@pobox.com>
Mon, 29 Jun 2026 17:42:35 +0000 (10:42 -0700)
commitae68032a8d0427bf90bbc316f662320d15933fdc
treed6128289540cf6a7eb2d1b7c9d70480c68e70004
parent18cf52c8a590d00c333d3d20edc2cf8c11c8ab92
commit-reach: guard !FIND_ALL early exit with generation ordering check

When paint_down_to_common() falls back to commit-date ordering (for
v1 commit graphs without corrected commit dates), the !FIND_ALL early
exit incorrectly fires.  The exit assumes the queue is generation-
ordered, so the first RESULT commit found must be the shallowest.
With date ordering this is not guaranteed: a closer merge base with
a lower committer date (clock skew) may still be in the queue behind
deeper commits.

Add a gen_ordered flag that is cleared when the date fallback fires,
and require it for the early exit.

Update the test from the previous commit to test_expect_success.

Signed-off-by: Kristofer Karlsson <krka@spotify.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
commit-reach.c
t/t6600-test-reach.sh