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
This commit is contained in:
Ivan Frade 2023-10-13 14:06:37 -07:00
parent 9323b430b9
commit f91afe5f57
1 changed files with 2 additions and 1 deletions

View File

@ -310,7 +310,8 @@ private PackObjectSizeIndex getObjectSizeIndex(DfsReader ctx)
return objectSizeIndex;
}
if (objectSizeIndexLoadAttempted) {
if (objectSizeIndexLoadAttempted
|| !desc.hasFileExt(OBJECT_SIZE_INDEX)) {
// Pack doesn't have object size index
return null;
}