From b5da75bb87b404046a0b242ad97628bd97d60b0d Mon Sep 17 00:00:00 2001 From: "Shawn O. Pearce" Date: Sat, 5 Feb 2011 18:23:18 -0800 Subject: [PATCH] UploadPack: Don't discard COMMON, SATISIFIED flags When the walker resets, its going to scrub the COMMON and SATISIFIED flags off a commit if the commit is contained within another commit the client wants. This is common if the client asks for both a 'maint' and 'master' branch, and 'maint' is also fully merged into 'master'. COMMON shouldn't be scrubbed during reset because its used to control membership of the commonBase collection, which is a List. commonBase should technically be a set, but membership is cheaper with a RevFlag. COMMON appears on a commit reachable from a WANT when there is also a PEER_HAS flag present, as this is a merge base. Scrubbing this off when another branch is tested isn't useful. SATISIFIED is a cache to tell us if wantSatisified() has already completed for this particular WANT. If it has, there isn't a need to recompute on that branch. Scrubbing it off 'maint' when we test 'master' just means we would later need to re-test 'maint', wasting CPU time on the server. Bug: 301639 Change-Id: I3bb67d68212e4f579e8c5dfb138f007b406d775f Signed-off-by: Shawn O. Pearce --- org.eclipse.jgit/src/org/eclipse/jgit/transport/UploadPack.java | 2 ++ 1 file changed, 2 insertions(+) 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 69bba0341..86ec65356 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/transport/UploadPack.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/transport/UploadPack.java @@ -195,6 +195,8 @@ public class UploadPack { SAVE = new RevFlagSet(); SAVE.add(WANT); SAVE.add(PEER_HAS); + SAVE.add(COMMON); + SAVE.add(SATISFIED); refFilter = RefFilter.DEFAULT; }