summaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit.test
diff options
context:
space:
mode:
authorDariusz Luksza <dariusz.luksza@gmail.com>2023-11-20 11:00:51 +0000
committerDariusz Luksza <dariusz.luksza@gmail.com>2024-01-29 09:33:36 +0000
commitca54c517647957685aa3401e097871aaebf250e3 (patch)
tree38702b3562dfab935f7a62ae440e71e033d952d5 /org.eclipse.jgit.test
parent60af389b49fe1d05753a4a2b9146d1b925c71e23 (diff)
downloadjgit-ca54c517647957685aa3401e097871aaebf250e3.tar.gz
jgit-ca54c517647957685aa3401e097871aaebf250e3.zip
Fix handling of missing pack index file
As demonstrated in `UploadPackHandleDeletedPackFile.testV2IdxFileRemovedDuringUploadPack` the fetch operation will fail when the pack index file is removed. This is due to a wrapping of `FileNotFoundException` (which is a subclass of `IOExeption`) in an `IOException` at PackIndex L#68. This is then changing the behaviour of error handling in `Pack.file.getBitmapIndex()` where the `FileNotFoundException` is swallowed and allows the fetch process to continue. With FNFE being wrapped in IOE, this blows up and breaks the fetch operation. Simply rethrowing `FileNotFoundException` from `PackFile.open()` fixes the broken fetch operation. This will also mark the whole pack as invalid in the `IOException` handler in `Pack.idx()` method. Change-Id: Ibe321aa1af21d26500e1cb2eb3464cc99a6dbc62 Signed-off-by: Dariusz Luksza <dariusz.luksza@gmail.com> (cherry picked from commit e0910eda3ea1c474b4cf9b00ac698f739a982f8c)
Diffstat (limited to 'org.eclipse.jgit.test')
-rw-r--r--org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/UploadPackHandleDeletedPackFileTest.java2
1 files changed, 0 insertions, 2 deletions
diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/UploadPackHandleDeletedPackFileTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/UploadPackHandleDeletedPackFileTest.java
index b1c9447c7f..417ce61df2 100644
--- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/UploadPackHandleDeletedPackFileTest.java
+++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/UploadPackHandleDeletedPackFileTest.java
@@ -32,7 +32,6 @@ import org.eclipse.jgit.lib.Repository;
import org.eclipse.jgit.revwalk.RevCommit;
import org.eclipse.jgit.transport.UploadPack.RequestPolicy;
import org.junit.Before;
-import org.junit.Ignore;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.Parameterized;
@@ -80,7 +79,6 @@ public class UploadPackHandleDeletedPackFileTest
}
@Test
- @Ignore("pending fix")
public void testV2IdxFileRemovedDuringUploadPack() throws Exception {
doRemovePackFileDuringUploadPack(PackExt.INDEX);
}