diff options
author | Matthias Sohn <matthias.sohn@sap.com> | 2017-08-14 23:37:44 +0200 |
---|---|---|
committer | Matthias Sohn <matthias.sohn@sap.com> | 2017-08-14 23:43:05 +0200 |
commit | 985e3c641491c06eabe210391c2582e749bb6acf (patch) | |
tree | d0dcbaebe3958c21e505d75fc56f7962c8a5a1d6 /org.eclipse.jgit | |
parent | d9fd35281b1817d349b5142104dd6c2428c6a548 (diff) | |
parent | 1ed1e40387c859786cf1932d22fe0001fbd5abb6 (diff) | |
download | jgit-985e3c641491c06eabe210391c2582e749bb6acf.tar.gz jgit-985e3c641491c06eabe210391c2582e749bb6acf.zip |
Merge branch 'stable-4.5' into stable-4.6
* stable-4.5:
Fix exception handling for opening bitmap index files
Change-Id: Ifb511238e3e98b1bc9f79a990807b940a17ebaa6
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
Diffstat (limited to 'org.eclipse.jgit')
-rw-r--r-- | org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/PackFile.java | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/PackFile.java b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/PackFile.java index 038172f92d..b5889f2dd4 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/PackFile.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/file/PackFile.java @@ -1105,8 +1105,17 @@ public class PackFile implements Iterable<PackIndex.MutableEntry> { if (invalid || invalidBitmap) return null; if (bitmapIdx == null && hasExt(BITMAP_INDEX)) { - final PackBitmapIndex idx = PackBitmapIndex.open( - extFile(BITMAP_INDEX), idx(), getReverseIdx()); + final PackBitmapIndex idx; + try { + idx = PackBitmapIndex.open(extFile(BITMAP_INDEX), idx(), + getReverseIdx()); + } catch (FileNotFoundException e) { + // Once upon a time this bitmap file existed. Now it + // has been removed. Most likely an external gc has + // removed this packfile and the bitmap + invalidBitmap = true; + return null; + } // At this point, idx() will have set packChecksum. if (Arrays.equals(packChecksum, idx.packChecksum)) |