diff options
author | Dave Borowitz <dborowitz@google.com> | 2019-06-03 14:03:49 -0700 |
---|---|---|
committer | Jonathan Nieder <jrn@google.com> | 2019-06-27 16:27:33 -0700 |
commit | 4973f05252b2159d9ceff4f480d252a596a669a1 (patch) | |
tree | 30eb4328601a56c3fed5eced07fa37f06c0be90e /org.eclipse.jgit/src/org/eclipse/jgit/revwalk/MergeBaseGenerator.java | |
parent | cbccfed4b39fd49cdb5366194b516a32ace58d62 (diff) | |
download | jgit-4973f05252b2159d9ceff4f480d252a596a669a1.tar.gz jgit-4973f05252b2159d9ceff4f480d252a596a669a1.zip |
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 <dborowitz@google.com>
Signed-off-by: Alex Spradlin <alexaspradlin@google.com>
Diffstat (limited to 'org.eclipse.jgit/src/org/eclipse/jgit/revwalk/MergeBaseGenerator.java')
-rw-r--r-- | org.eclipse.jgit/src/org/eclipse/jgit/revwalk/MergeBaseGenerator.java | 3 |
1 files changed, 2 insertions, 1 deletions
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 { |