diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/storage/dfs/DfsPackFile.java b/org.eclipse.jgit/src/org/eclipse/jgit/storage/dfs/DfsPackFile.java index daad02a14..13f3c3698 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/storage/dfs/DfsPackFile.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/storage/dfs/DfsPackFile.java @@ -171,6 +171,12 @@ public final class DfsPackFile { return packDesc; } + /** @return whether the pack index file is loaded and cached in memory. */ + public boolean isIndexLoaded() { + DfsBlockCache.Ref idxref = index; + return idxref != null && idxref.get() != null; + } + /** @return bytes cached in memory for this pack, excluding the index. */ public long getCachedSize() { return key.cachedSize.get();