aboutsummaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit/src
diff options
context:
space:
mode:
authorShawn O. Pearce <spearce@spearce.org>2010-04-16 08:11:30 -0700
committerShawn O. Pearce <spearce@spearce.org>2010-04-16 16:32:33 -0700
commit329a0e1689f2493b7034d15185f4fbf59c9e49bb (patch)
treef1cabc2f7fb5d69ac43762b3bd10304a37477b58 /org.eclipse.jgit/src
parent8279361de8ca9a216c6dbfcc02591c011308223b (diff)
downloadjgit-329a0e1689f2493b7034d15185f4fbf59c9e49bb.tar.gz
jgit-329a0e1689f2493b7034d15185f4fbf59c9e49bb.zip
ReceivePack: Remove need new,base object id properties
These are more like internal implementation details of how IndexPack works with ReceivePack to validate the incoming object stream. Callers who are embedding the ReceivePack logic in their own application don't really need to know the details of which objects were used for delta bases in the incoming thin pack, or exactly which objects were newly transmitted. Hide these from the API, as exposing them through ReceivePack was an early mistake. Change-Id: I7ee44a314fa19e6a8520472ce05de92c324ad43e Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Diffstat (limited to 'org.eclipse.jgit/src')
-rw-r--r--org.eclipse.jgit/src/org/eclipse/jgit/transport/ReceivePack.java53
1 files changed, 4 insertions, 49 deletions
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/transport/ReceivePack.java b/org.eclipse.jgit/src/org/eclipse/jgit/transport/ReceivePack.java
index 46912847d0..8dbeb95985 100644
--- a/org.eclipse.jgit/src/org/eclipse/jgit/transport/ReceivePack.java
+++ b/org.eclipse.jgit/src/org/eclipse/jgit/transport/ReceivePack.java
@@ -184,10 +184,6 @@ public class ReceivePack {
/** Lock around the received pack file, while updating refs. */
private PackLock packLock;
- private boolean needNewObjectIds;
-
- private boolean needBaseObjectIds;
-
private boolean ensureObjectsProvidedVisible;
/**
@@ -256,45 +252,6 @@ public class ReceivePack {
}
/**
- * Configure this receive pack instance to keep track of the objects assumed
- * for delta bases.
- * <p>
- * By default a receive pack doesn't save the objects that were used as
- * delta bases. Setting this flag to {@code true} will allow the caller to
- * use {@link #getBaseObjectIds()} to retrieve that list.
- *
- * @param b {@code true} to enable keeping track of delta bases.
- */
- public void setNeedBaseObjectIds(boolean b) {
- this.needBaseObjectIds = b;
- }
-
- /**
- * @return the set of objects the incoming pack assumed for delta purposes
- */
- public final Set<ObjectId> getBaseObjectIds() {
- return ip.getBaseObjectIds();
- }
-
- /**
- * Configure this receive pack instance to keep track of new objects.
- * <p>
- * By default a receive pack doesn't save the new objects that were created
- * when it was instantiated. Setting this flag to {@code true} allows the
- * caller to use {@link #getNewObjectIds()} to retrieve that list.
- *
- * @param b {@code true} to enable keeping track of new objects.
- */
- public void setNeedNewObjectIds(boolean b) {
- this.needNewObjectIds = b;
- }
-
- /** @return the new objects that were sent by the user */
- public final Set<ObjectId> getNewObjectIds() {
- return ip.getNewObjectIds();
- }
-
- /**
* Configure this receive pack instance to ensure that the provided
* objects are visible to the user.
* <p>
@@ -804,9 +761,8 @@ public class ReceivePack {
ip = IndexPack.create(db, rawIn);
ip.setFixThin(true);
- ip.setNeedNewObjectIds(needNewObjectIds || ensureObjectsProvidedVisible);
- ip.setNeedBaseObjectIds(needBaseObjectIds
- || ensureObjectsProvidedVisible);
+ ip.setNeedNewObjectIds(ensureObjectsProvidedVisible);
+ ip.setNeedBaseObjectIds(ensureObjectsProvidedVisible);
ip.setObjectChecking(isCheckReceivedObjects());
ip.index(NullProgressMonitor.INSTANCE);
@@ -823,7 +779,7 @@ public class ReceivePack {
final Set<ObjectId> baseObjects;
if (ensureObjectsProvidedVisible)
- baseObjects = getBaseObjectIds();
+ baseObjects = ip.getBaseObjectIds();
else
baseObjects = Collections.emptySet();
@@ -857,9 +813,8 @@ public class ReceivePack {
if (!b.has(RevFlag.UNINTERESTING))
throw new MissingObjectException(b, b.getType());
}
- for (ObjectId id : getNewObjectIds()) {
+ for (ObjectId id : ip.getNewObjectIds())
provided.add(id);
- }
}
RevCommit c;