diff options
author | Colby Ranger <cranger@google.com> | 2012-11-01 08:58:00 -0700 |
---|---|---|
committer | Colby Ranger <cranger@google.com> | 2012-11-01 09:07:52 -0700 |
commit | f6f8bcd9df74a56b8697c4272bee99168b46ab9d (patch) | |
tree | e05828b9d3d01e5e7d40fa772d1980c072af5e42 | |
parent | b7f5ed561249b8c224d2a8844832b9fbba6e9f41 (diff) | |
download | jgit-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.java | 6 |
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(); |