From 88ca88a32bba8d5a59bae1901990f3bc643545eb Mon Sep 17 00:00:00 2001 From: Luca Milanesio Date: Sat, 10 Jun 2023 01:20:44 +0100 Subject: Add verification in GcKeepFilesTest that bitmaps are generated The packfiles with the .keep extensions are meant to prevent a packfile from being processed or removed during GC. From the point of view of the GC process then, the associated packfile should be completely transparent: - it should not included in the repacked file - it should not pruned - its objects should be left untouched, even if unreachable - the GC process, including the bitmap generation should continue as usual, as the the packfiles with .keep file did not exist Add one explicit test for making sure that the management of .keep file is also transparent to the generation of bitmaps, which are still generated if a .keep file exists. Bug: 582039 Change-Id: I14f6adc3f961c606fbc617e51ea6ed6e2ef8604f --- .../tst/org/eclipse/jgit/internal/storage/file/GcKeepFilesTest.java | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'org.eclipse.jgit.test/tst/org') diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/GcKeepFilesTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/GcKeepFilesTest.java index 5fcdd37575..67848ae7ea 100644 --- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/GcKeepFilesTest.java +++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/GcKeepFilesTest.java @@ -48,11 +48,15 @@ public class GcKeepFilesTest extends GcTestCase { assertEquals(4, stats.numberOfLooseObjects); assertEquals(4, stats.numberOfPackedObjects); assertEquals(1, stats.numberOfPackFiles); + PackFile bitmapFile = singlePack.getPackFile().create(PackExt.BITMAP_INDEX); + assertTrue(keepFile.exists()); + assertTrue(bitmapFile.delete()); gc.gc(); stats = gc.getStatistics(); assertEquals(0, stats.numberOfLooseObjects); assertEquals(8, stats.numberOfPackedObjects); assertEquals(2, stats.numberOfPackFiles); + assertEquals(1, stats.numberOfBitmaps); // check that no object is packed twice Iterator packs = repo.getObjectDatabase().getPacks() -- cgit v1.2.3