diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/storage/dfs/DfsPackDescription.java b/org.eclipse.jgit/src/org/eclipse/jgit/storage/dfs/DfsPackDescription.java index 62fce3b73..9cb29af5d 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/storage/dfs/DfsPackDescription.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/storage/dfs/DfsPackDescription.java @@ -168,13 +168,6 @@ public class DfsPackDescription implements Comparable { return size == null ? 0 : size.longValue(); } - /** - * @return size of the reverse index, in bytes. - */ - public int getReverseIndexSize() { - return (int) Math.min(objectCount * 8, Integer.MAX_VALUE); - } - /** @return number of objects in the pack. */ public long getObjectCount() { return objectCount; 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 8a4bd2e53..4c41557e5 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 @@ -283,9 +283,11 @@ public final class DfsPackFile { return revidx; } - PackReverseIndex revidx = new PackReverseIndex(idx(ctx)); - reverseIndex = cache.put(key, POS_REVERSE_INDEX, - packDesc.getReverseIndexSize(), revidx); + PackIndex idx = idx(ctx); + PackReverseIndex revidx = new PackReverseIndex(idx); + int sz = (int) Math.min( + idx.getObjectCount() * 8, Integer.MAX_VALUE); + reverseIndex = cache.put(key, POS_REVERSE_INDEX, sz, revidx); return revidx; } }