]> source.dussan.org Git - jgit.git/commitdiff
Allow public access to PackIndex 36/42936/4
authorDavid Pletcher <dpletcher@google.com>
Sat, 28 Feb 2015 01:17:52 +0000 (17:17 -0800)
committerShawn Pearce <spearce@spearce.org>
Mon, 2 Mar 2015 20:52:27 +0000 (15:52 -0500)
The index provides access to a list of objects in a pack.
This will be helpful for repository integrity checking.

Change-Id: I435eeeb3fe1b1f5632d40528936416e97491d412
Signed-off-by: David Pletcher <dpletcher@google.com>
org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/dfs/DfsPackFile.java

index 5d130b6d618a3fd2ed6297eb6de37756fc4daaa4..45e9fc15585218354fe11d038647622afac20fa5 100644 (file)
@@ -214,7 +214,17 @@ public final class DfsPackFile implements AutoCloseable {
                index = cache.put(key, POS_INDEX, sz, idx);
        }
 
-       PackIndex getPackIndex(DfsReader ctx) throws IOException {
+       /**
+        * Get the PackIndex for this PackFile.
+        *
+        * @param ctx
+        *            reader context to support reading from the backing store if
+        *            the index is not already loaded in memory.
+        * @return the PackIndex.
+        * @throws IOException
+        *             the pack index is not available, or is corrupt.
+        */
+       public PackIndex getPackIndex(DfsReader ctx) throws IOException {
                return idx(ctx);
        }