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 <me@ttaylorr.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Taylor Blau committed
Aug 15, 2024 at 13:31 UTC
42f80e361c59b7afc0258e44299fa0263c4cfbaf
1 file changed
+20
t/t5333-pseudo-merge-bitmaps.sh
+20
@@ -390,4 +390,24 @@ test_expect_success 'pseudo-merge reuse' '
390
)
391
'
392
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
+
413
test_done