diff options
author | Matthias Sohn <matthias.sohn@sap.com> | 2020-11-27 10:10:35 +0100 |
---|---|---|
committer | Matthias Sohn <matthias.sohn@sap.com> | 2020-11-27 10:10:44 +0100 |
commit | d4fe93f55bcdf3115a53ac69c1594dd7799e2453 (patch) | |
tree | b29d6f507a435913d8ac96af58c38fb0205b2efd /org.eclipse.jgit.test/tst/org | |
parent | 63f16c53c8a855a05063b495c33a88d049f4e400 (diff) | |
parent | 5cd485e5dda41d2ef06226a692c64f1aa221eb25 (diff) | |
download | jgit-d4fe93f55bcdf3115a53ac69c1594dd7799e2453.tar.gz jgit-d4fe93f55bcdf3115a53ac69c1594dd7799e2453.zip |
Merge branch 'stable-5.9' into stable-5.10
* stable-5.9:
Remove unused imports
Silence API warnings
Remove erraneously merged source features
Prepare 5.3.9-SNAPSHOT builds
JGit v5.3.8.202011260953-r
Prepare 5.1.15-SNAPSHOT builds
JGit v5.1.14.202011251942-r
GC#deleteOrphans: log warning for deleted orphaned files
GC#deleteOrphans: handle failure to list files in pack directory
Ensure that GC#deleteOrphans respects pack lock
PacketLineIn: ensure that END != DELIM
Update API warning filters
Remove unused imports
Change-Id: Icf415ac5bab2f69f71189c942424ee69f8a64d4e
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
Diffstat (limited to 'org.eclipse.jgit.test/tst/org')
-rw-r--r-- | org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/GcOrphanFilesTest.java | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/GcOrphanFilesTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/GcOrphanFilesTest.java index 84d364b985..c5c316d357 100644 --- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/GcOrphanFilesTest.java +++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/internal/storage/file/GcOrphanFilesTest.java @@ -24,10 +24,14 @@ public class GcOrphanFilesTest extends GcTestCase { private static final String BITMAP_File_1 = PACK + "-1.bitmap"; + private static final String BITMAP_File_2 = PACK + "-2.bitmap"; + private static final String IDX_File_2 = PACK + "-2.idx"; private static final String IDX_File_malformed = PACK + "-1234idx"; + private static final String KEEP_File_2 = PACK + "-2.keep"; + private static final String PACK_File_2 = PACK + "-2.pack"; private static final String PACK_File_3 = PACK + "-3.pack"; @@ -72,6 +76,22 @@ public class GcOrphanFilesTest extends GcTestCase { assertTrue(new File(packDir, IDX_File_malformed).exists()); } + @Test + public void keepPreventsDeletionOfIndexFilesForMissingPackFile() + throws Exception { + createFileInPackFolder(BITMAP_File_1); + createFileInPackFolder(IDX_File_2); + createFileInPackFolder(BITMAP_File_2); + createFileInPackFolder(KEEP_File_2); + createFileInPackFolder(PACK_File_3); + gc.gc(); + assertFalse(new File(packDir, BITMAP_File_1).exists()); + assertTrue(new File(packDir, BITMAP_File_2).exists()); + assertTrue(new File(packDir, IDX_File_2).exists()); + assertTrue(new File(packDir, KEEP_File_2).exists()); + assertTrue(new File(packDir, PACK_File_3).exists()); + } + private void createFileInPackFolder(String fileName) throws IOException { if (!packDir.exists() || !packDir.isDirectory()) { assertTrue(packDir.mkdirs()); |