]> source.dussan.org Git - jgit.git/commit
RevWalk: Traverse all parents of UNINTERESTING commits 59/147659/10
authorAlex Spradlin <alexaspradlin@google.com>
Tue, 13 Aug 2019 22:20:07 +0000 (15:20 -0700)
committerAlex Spradlin <alexaspradlin@google.com>
Mon, 26 Aug 2019 22:53:42 +0000 (15:53 -0700)
commita80df5380f6f94a8fccaaecac673e3ec9c29bb89
tree6c762c48422f747f4d1ab390963f8a1c07677475
parentdb0eb9f8aef0beed0a8017d455bf016f2aae7647
RevWalk: Traverse all parents of UNINTERESTING commits

When firstParent is set, RevWalk traverses only the first parent of a
commit, even though that commit is UNINTERESTING. Since we want the
maximal UNINTERESTING set, we shouldn't prune any parents here. This
issue is apparent only when some of the commits being traversed are
unparsed, since walker.carryFlagsImpl() propagates the UNINTERESTING
flag to all parsed ancestors, masking the issue.

Therefore teach RevWalk to traverse all parents when a commit is
UNINTERESTING and not only the first parent. Since this issue is
masked by commit parsing, also test situations when the commits
involved are unparsed.

Signed-off-by: Alex Spradlin <alexaspradlin@google.com>
Change-Id: I95e2ad9ae8f1f50fbecae674367ee7e0855519b1
org.eclipse.jgit.junit/src/org/eclipse/jgit/junit/TestRepository.java
org.eclipse.jgit.test/tst/org/eclipse/jgit/revwalk/FirstParentRevWalkTest.java
org.eclipse.jgit.test/tst/org/eclipse/jgit/revwalk/RevWalkTestCase.java
org.eclipse.jgit/src/org/eclipse/jgit/revwalk/PendingGenerator.java