summaryrefslogtreecommitdiffstats
path: root/t/t5333-pseudo-merge-bitmaps.sh
diff options
context:
space:
mode:
authorTaylor Blau <me@ttaylorr.com>2024-08-15 19:31:14 +0200
committerJunio C Hamano <gitster@pobox.com>2024-08-15 20:26:35 +0200
commit42f80e361c59b7afc0258e44299fa0263c4cfbaf (patch)
tree66d33b0b9eb08c4a34ecdc7becdb349f2641b8e3 /t/t5333-pseudo-merge-bitmaps.sh
parentpack-bitmap-write.c: select pseudo-merges even for small bitmaps (diff)
downloadgit-42f80e361c59b7afc0258e44299fa0263c4cfbaf.tar.xz
git-42f80e361c59b7afc0258e44299fa0263c4cfbaf.zip
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>
Diffstat (limited to '')
-rwxr-xr-xt/t5333-pseudo-merge-bitmaps.sh20
1 files changed, 20 insertions, 0 deletions
diff --git a/t/t5333-pseudo-merge-bitmaps.sh b/t/t5333-pseudo-merge-bitmaps.sh
index f052f395a7..0288691340 100755
--- a/t/t5333-pseudo-merge-bitmaps.sh
+++ b/t/t5333-pseudo-merge-bitmaps.sh
@@ -390,4 +390,24 @@ test_expect_success 'pseudo-merge reuse' '
)
'
+test_expect_failure 'empty pseudo-merge group' '
+ git init pseudo-merge-empty-group &&
+ (
+ cd pseudo-merge-empty-group &&
+
+ # Ensure that a pseudo-merge group with no unstable
+ # commits does not generate an empty pseudo-merge
+ # bitmap.
+ git config bitmapPseudoMerge.empty.pattern refs/ &&
+
+ test_commit base &&
+ git repack -adb &&
+
+ test-tool bitmap dump-pseudo-merges >merges &&
+ test_line_count = 1 merges &&
+
+ test 0 -eq "$(grep -c commits=0 <merges)"
+ )
+'
+
test_done