diff options
author | Shawn Pearce <sop@google.com> | 2012-11-01 13:07:23 -0400 |
---|---|---|
committer | Gerrit Code Review @ Eclipse.org <gerrit@eclipse.org> | 2012-11-01 13:07:23 -0400 |
commit | 8acaae802c8908712663b0c21b7b09ac602ecb1d (patch) | |
tree | 6762063ffcd3fb947fef721257e5eae3384ce29a /org.eclipse.jgit/src | |
parent | 69b2a9f53915cab0378acd7c10dea65c1c23a431 (diff) | |
parent | f6f8bcd9df74a56b8697c4272bee99168b46ab9d (diff) | |
download | jgit-8acaae802c8908712663b0c21b7b09ac602ecb1d.tar.gz jgit-8acaae802c8908712663b0c21b7b09ac602ecb1d.zip |
Merge "Add isIndexLoaded() to DfsPackFile."
Diffstat (limited to 'org.eclipse.jgit/src')
-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(); |