summaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit.test
diff options
context:
space:
mode:
authorLuca Milanesio <luca.milanesio@gmail.com>2023-06-10 01:20:44 +0100
committerMatthias Sohn <matthias.sohn@sap.com>2023-07-05 15:30:11 +0200
commit88ca88a32bba8d5a59bae1901990f3bc643545eb (patch)
treece027f237ffe11cf61d6bba9e29f5b4c4efe8aea /org.eclipse.jgit.test
parent3a6eec9bb697a599a32ccb08ee176e6d4982f90f (diff)
downloadjgit-88ca88a32bba8d5a59bae1901990f3bc643545eb.tar.gz
jgit-88ca88a32bba8d5a59bae1901990f3bc643545eb.zip
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
Diffstat (limited to 'org.eclipse.jgit.test')
-rw-r--r--org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/GcKeepFilesTest.java4
1 files changed, 4 insertions, 0 deletions
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<Pack> packs = repo.getObjectDatabase().getPacks()