]> source.dussan.org Git - jgit.git/commit
DfsCachedPack: Add accessor for packfile object 31/148531/2
authorJonathan Tan <jonathantanmy@google.com>
Wed, 28 Aug 2019 16:45:21 +0000 (09:45 -0700)
committerJonathan Tan <jonathantanmy@google.com>
Wed, 28 Aug 2019 17:28:42 +0000 (10:28 -0700)
commitf1f7b4288272ae932038c4d83546c91edb856a3e
treed12cb7cb9b6a4132c50b8675ccc33c8d084fcaa3
parent9d04f8f7697221edd837d3055336e19e85448475
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 <jonathantanmy@google.com>
org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/dfs/DfsCachedPack.java