From 60206ea95f1bff6a301ee65e532a27e085812a5d Mon Sep 17 00:00:00 2001 From: Ivan Frade Date: Tue, 14 Dec 2021 16:24:26 -0800 Subject: [PATCH] PackedObjectInfo: add the full size to the description So we can create a size index later. Change-Id: I9db47ced929fbf045fc37bead6449bbf5484d308 --- .../jgit/transport/PackedObjectInfo.java | 36 +++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/transport/PackedObjectInfo.java b/org.eclipse.jgit/src/org/eclipse/jgit/transport/PackedObjectInfo.java index fe1209b6a..bf7997ec6 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/transport/PackedObjectInfo.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/transport/PackedObjectInfo.java @@ -31,6 +31,8 @@ public class PackedObjectInfo extends ObjectIdOwnerMap.Entry { private long sizeBeforeInflating; + private long fullSize; + PackedObjectInfo(final long headerOffset, final int packedCRC, final AnyObjectId id) { super(id); @@ -111,11 +113,45 @@ public void setType(int type) { this.type = type; } + /** + * Size in storage + * + * @param sizeBeforeInflating + */ void setSize(long sizeBeforeInflating) { this.sizeBeforeInflating = sizeBeforeInflating; } + /** + * Size in storage (maybe deflated and/or deltified). + * + * This is the size in storage. In packs, this is the bytes used by the + * object contents (themselves or as deltas) compressed by zlib (deflated). + * + * @return size in storage + */ long getSize() { return sizeBeforeInflating; } + + /** + * Real (materialized) size of the object (inflated, undeltified) + * + * @param size + * size of the object in bytes, without compressing nor + * deltifying + * @since 6.4 + */ + public void setFullSize(long size) { + this.fullSize = size; + } + + /** + * @return size of the object (inflated, undeltified) + * + * @since 6.4 + */ + public long getFullSize() { + return fullSize; + } }