Browse Source

Add isIndexLoaded() to DfsPackFile.

The method reports whether the index file for the pack has been loaded
and cached in memory.

Change-Id: Ifa8d63f737458e102cb3d28579c9711d46693d17
stable-2.2
Colby Ranger 12 years ago
parent
commit
f6f8bcd9df
  1. 6
      org.eclipse.jgit/src/org/eclipse/jgit/storage/dfs/DfsPackFile.java

6
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<PackIndex> 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();

Loading…
Cancel
Save