pseudo-merge.c: do not generate empty pseudo-merge commits

The previous commit demonstrated it is possible to generate empty
pseudo-merge commits, which is not useful as such pseudo-merges carry no
information.

Ensure that we only generate non-empty groups by not pushing a new
commit onto the bitmap_writer when that commit has no parents.

Signed-off-by: Taylor Blau <me@ttaylorr.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Taylor Blau
2024-08-15 13:31:17 -04:00
committed by Junio C Hamano
parent 42f80e361c
commit 25b78668de
2 changed files with 8 additions and 5 deletions

View File

@ -390,7 +390,7 @@ test_expect_success 'pseudo-merge reuse' '
)
'
test_expect_failure 'empty pseudo-merge group' '
test_expect_success 'empty pseudo-merge group' '
git init pseudo-merge-empty-group &&
(
cd pseudo-merge-empty-group &&