From 4973f05252b2159d9ceff4f480d252a596a669a1 Mon Sep 17 00:00:00 2001 From: Dave Borowitz Date: Mon, 3 Jun 2019 14:03:49 -0700 Subject: RevWalk: Add a setFirstParent that mimics C git's --first-parent RevWalk does not currently provide a --first-parent equivalent and the feature has been requested. Add a field to the RevWalk class to specify whether walks should traverse first parents only. Modify Generator implementations to support the feature. Change-Id: I4a9a0d5767f82141dcf6d08659d7cb77c585fae4 Signed-off-by: Dave Borowitz Signed-off-by: Alex Spradlin --- org.eclipse.jgit/src/org/eclipse/jgit/revwalk/MergeBaseGenerator.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'org.eclipse.jgit/src/org/eclipse/jgit/revwalk/MergeBaseGenerator.java') diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/MergeBaseGenerator.java b/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/MergeBaseGenerator.java index 2fe95318b2..4ea57cb51b 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/MergeBaseGenerator.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/MergeBaseGenerator.java @@ -85,8 +85,9 @@ class MergeBaseGenerator extends Generator { private CarryStack stack; MergeBaseGenerator(RevWalk w) { + super(w.isFirstParent()); walker = w; - pending = new DateRevQueue(); + pending = new DateRevQueue(firstParent); } void init(AbstractRevQueue p) throws IOException { -- cgit v1.2.3