From f1f7b4288272ae932038c4d83546c91edb856a3e Mon Sep 17 00:00:00 2001 From: Jonathan Tan Date: Wed, 28 Aug 2019 09:45:21 -0700 Subject: [PATCH] DfsCachedPack: Add accessor for packfile object In order to support implementations of CachedPackUriProvider (which need to supply, among other things, the checksum of the packfile corresponding to a CachedPack), in a004820858 ("UploadPack: support custom packfile-to-URI mapping", 2019-08-20), the method getCheckSum() was added to PackIndex. However, there is no way to access the PackIndex from a DfsCachedPack. Therefore, add an accessor for the DfsPackFile stored in the DfsCachedPack. Now, a user who has a DfsCachedPack can use DfsCachedPack#getPackFile then DfsPackFile#getPackIndex then PackIndex#getCheckSum to obtain the checksum of a pack. Change-Id: Ia010c016f6cac0f058ee20eff4c10f57338bfefc Signed-off-by: Jonathan Tan --- .../eclipse/jgit/internal/storage/dfs/DfsCachedPack.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/dfs/DfsCachedPack.java b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/dfs/DfsCachedPack.java index 3605236e56..9b280747df 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/dfs/DfsCachedPack.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/dfs/DfsCachedPack.java @@ -60,6 +60,13 @@ public class DfsCachedPack extends CachedPack { this.pack = pack; } + /** + * @return the pack passed to the constructor + */ + public DfsPackFile getPackFile() { + return pack; + } + /** * Get the description of the pack. * -- 2.39.5