From 0fe7eeba04b097828a68ea6558b04aebf27fd858 Mon Sep 17 00:00:00 2001 From: "Shawn O. Pearce" Date: Sat, 5 Feb 2011 18:47:42 -0800 Subject: [PATCH] UploadPack: Tag non-commits SATISIFIED earlier This gets non-commits out of the wantSatisfied() main loop by making use of the cached SATISIFIED flag and its existing bypass. Anything that isn't a commit cannot be discovered by the have negotiation, so its always assumed to be SATISIFIED by the server. Bug: 301639 Change-Id: I1ef354fbf2e2ed44c9020a4069d7179f2159f19f Signed-off-by: Shawn O. Pearce --- .../src/org/eclipse/jgit/transport/UploadPack.java | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/transport/UploadPack.java b/org.eclipse.jgit/src/org/eclipse/jgit/transport/UploadPack.java index 86ec65356..63fa503b1 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/transport/UploadPack.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/transport/UploadPack.java @@ -499,6 +499,9 @@ public class UploadPack { wantAll.add(obj); } + if (!(obj instanceof RevCommit)) + obj.add(SATISFIED); + if (obj instanceof RevTag) { RevObject target = walk.peel(obj); if (target instanceof RevCommit) { @@ -601,11 +604,6 @@ public class UploadPack { if (want.has(SATISFIED)) return true; - if (!(want instanceof RevCommit)) { - want.add(SATISFIED); - return true; - } - walk.resetRetain(SAVE); walk.markStart((RevCommit) want); for (;;) {