Allow public access to PackIndex

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>
This commit is contained in:
David Pletcher 2015-02-27 17:17:52 -08:00 committed by Shawn Pearce
parent 12a55c3475
commit cc8c270c9b
1 changed files with 11 additions and 1 deletions

View File

@ -214,7 +214,17 @@ void setPackIndex(PackIndex idx) {
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);
}