Skip to content

Commit f91afe5

Browse files
committed
DfsPackFile: Do not attempt to read stream if pack doesn't have it
Other getters (e.g. bitmap or commit graph) cover the case that the pack doesn't have the corresponding extension. Do the same here to detect this early and avoid an IOException in openFile. Change-Id: I29726b7ede0f795d35543453a3e7f92cee872a78
1 parent 9323b43 commit f91afe5

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/dfs/DfsPackFile.java

+2-1
Original file line numberDiff line numberDiff line change
@@ -310,7 +310,8 @@ private PackObjectSizeIndex getObjectSizeIndex(DfsReader ctx)
310310
return objectSizeIndex;
311311
}
312312

313-
if (objectSizeIndexLoadAttempted) {
313+
if (objectSizeIndexLoadAttempted
314+
|| !desc.hasFileExt(OBJECT_SIZE_INDEX)) {
314315
// Pack doesn't have object size index
315316
return null;
316317
}

0 commit comments

Comments
 (0)