diff options
author | Anna Papitto <annapapitto@google.com> | 2023-06-27 13:22:20 -0700 |
---|---|---|
committer | Anna Papitto <annapapitto@google.com> | 2023-06-27 13:25:29 -0700 |
commit | 91b23cc552c1038cf6e37d256ebb47eb83a8a5f6 (patch) | |
tree | 83cfccf0d056c9b26ce8269a98e50b1d062f7512 | |
parent | 55230e2b958c3fbc8fd7d31a28fdf44537bba305 (diff) | |
download | jgit-91b23cc552c1038cf6e37d256ebb47eb83a8a5f6.tar.gz jgit-91b23cc552c1038cf6e37d256ebb47eb83a8a5f6.zip |
DfsPackFile: make #getReverseIdx public
The DfsPackFile#getReverseIdx method, which wraps creating a
PackReverseIndex in caching, was package-private. This caused
implementations on top of DfsPackFile to directly instantiate a
PackReverseIndex in cases where it would benefit from caching.
Instead, make #getReverseIdx public so that the caching logic can be
reused by implementations where appropriate.
Change-Id: I4553e514a4ac320bfe2455c00023343ad97f9d15
Signed-off-by: Anna Papitto <annapapitto@google.com>
-rw-r--r-- | org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/dfs/DfsPackFile.java | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/dfs/DfsPackFile.java b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/dfs/DfsPackFile.java index 7e1f0ad87c..f61f8c61a9 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/dfs/DfsPackFile.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/dfs/DfsPackFile.java @@ -259,7 +259,17 @@ public final class DfsPackFile extends BlockBasedFile { return commitGraph; } - PackReverseIndex getReverseIdx(DfsReader ctx) throws IOException { + /** + * Get the PackReverseIndex 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 PackReverseIndex + * @throws java.io.IOException + * the pack index is not available, or is corrupt + */ + public PackReverseIndex getReverseIdx(DfsReader ctx) throws IOException { if (reverseIndex != null) { return reverseIndex; } |