summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorColby Ranger <cranger@google.com>2012-11-01 08:58:00 -0700
committerColby Ranger <cranger@google.com>2012-11-01 09:07:52 -0700
commitf6f8bcd9df74a56b8697c4272bee99168b46ab9d (patch)
treee05828b9d3d01e5e7d40fa772d1980c072af5e42
parentb7f5ed561249b8c224d2a8844832b9fbba6e9f41 (diff)
downloadjgit-f6f8bcd9df74a56b8697c4272bee99168b46ab9d.tar.gz
jgit-f6f8bcd9df74a56b8697c4272bee99168b46ab9d.zip
Add isIndexLoaded() to DfsPackFile.
The method reports whether the index file for the pack has been loaded and cached in memory. Change-Id: Ifa8d63f737458e102cb3d28579c9711d46693d17
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/storage/dfs/DfsPackFile.java6
1 files changed, 6 insertions, 0 deletions
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 daad02a14b..13f3c36981 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<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();