Skip to content

Commit 42f80e3

Browse files
ttaylorrgitster
authored andcommitted
t/t5333-pseudo-merge-bitmaps.sh: demonstrate empty pseudo-merge groups
Demonstrate that it is possible to generate empty pseudo-merge commits in certain cases. In the below instance, we generate one non-empty pseudo-merge (containing commit "base"), and one empty pseudo-merge group (corresponding to the unstable commits within that group). (In my testing, the pseudo-merge machinery seems to handle empty groups just fine, but generating them is pointless as they carry no information.) This commit (introducing a deliberate "test_expect_failure") is split out from the actual fix (which will appear in the following commit) to demonstrate that the failure is correctly induced. Signed-off-by: Taylor Blau <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 187504f commit 42f80e3

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

t/t5333-pseudo-merge-bitmaps.sh

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -390,4 +390,24 @@ test_expect_success 'pseudo-merge reuse' '
390390
)
391391
'
392392

393+
test_expect_failure 'empty pseudo-merge group' '
394+
git init pseudo-merge-empty-group &&
395+
(
396+
cd pseudo-merge-empty-group &&
397+
398+
# Ensure that a pseudo-merge group with no unstable
399+
# commits does not generate an empty pseudo-merge
400+
# bitmap.
401+
git config bitmapPseudoMerge.empty.pattern refs/ &&
402+
403+
test_commit base &&
404+
git repack -adb &&
405+
406+
test-tool bitmap dump-pseudo-merges >merges &&
407+
test_line_count = 1 merges &&
408+
409+
test 0 -eq "$(grep -c commits=0 <merges)"
410+
)
411+
'
412+
393413
test_done

0 commit comments

Comments
 (0)