summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorShawn O. Pearce <spearce@spearce.org>2010-07-09 07:59:30 -0700
committerShawn O. Pearce <spearce@spearce.org>2010-07-09 19:04:35 -0700
commit85b7a53d52c3f2bfb113cc665bd7893504cd4e50 (patch)
treec6a82bccc87651ce12e1ac446b387aaeecfefd32
parent6730f9e3c830d997d1731bf36414e626bda42ad8 (diff)
downloadjgit-85b7a53d52c3f2bfb113cc665bd7893504cd4e50.tar.gz
jgit-85b7a53d52c3f2bfb113cc665bd7893504cd4e50.zip
Refactor ObjectToPack's delta depth setting
Long ago when PackWriter is first written we thought that the delta depth could be updated automatically. But its never used. Instead make this a simple standard setter so the caller can more directly set the delta depth of this object. This permits us to configure a depth that takes into account more than just the depth of another object in this same pack. Change-Id: I1d71b74f2edd7029b8743a2c13b591098ce8cc8f Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/storage/pack/ObjectToPack.java9
1 files changed, 1 insertions, 8 deletions
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/storage/pack/ObjectToPack.java b/org.eclipse.jgit/src/org/eclipse/jgit/storage/pack/ObjectToPack.java
index 4016e92c9d..afab017525 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/storage/pack/ObjectToPack.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/storage/pack/ObjectToPack.java
@@ -179,14 +179,7 @@ public class ObjectToPack extends PackedObjectInfo {
return flags >>> DELTA_SHIFT;
}
- void updateDeltaDepth() {
- final int d;
- if (deltaBase instanceof ObjectToPack)
- d = ((ObjectToPack) deltaBase).getDeltaDepth() + 1;
- else if (deltaBase != null)
- d = 1;
- else
- d = 0;
+ void setDeltaDepth(int d) {
flags = (d << DELTA_SHIFT) | (flags & NON_DELTA_MASK);
}