From dd585b779f4739d5b7b4e69bf45ada10901b6312 Mon Sep 17 00:00:00 2001 From: Christian Halstrick Date: Tue, 13 Sep 2016 01:29:11 +0200 Subject: Fix carrying over flags during a RevWalk There was a bug when carrying over flags from a merge commit to its non-first parents. The first parent of a merge commit was handled differently and correct but the non-first parents are handled by a recursive algorithm. Flags should be copied from the root merge commit to parent-2, to grandparent-2, ... up to the limit of STACK_DEPTH==500 parents-levels. But the recursive algorithm was always copying only to the direct parents of the merge commit and not the grand*-parents. This seems to be no problem when commits are handled in a strict date order because then copying only one level is no problem if children are handled before parents. But when commits are not seperated anymore by distinctive correct dates (e.g. because all commits have the same date) then it may happen that a merge-parent is handled before the merge commit and when dealing later with the merge commit one has to copy flags down to more than one level Bug: 501211 Change-Id: I2d79a7cf1e3bce21a490905ccd9d5e502d7b8421 --- org.eclipse.jgit/src/org/eclipse/jgit/revwalk/RevCommit.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'org.eclipse.jgit/src/org/eclipse') diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/RevCommit.java b/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/RevCommit.java index e67ada6022..1e91006d47 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/RevCommit.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/revwalk/RevCommit.java @@ -244,7 +244,7 @@ public class RevCommit extends RevObject { if ((p.flags & carry) == carry) continue; p.flags |= carry; - FIFORevQueue q = carryFlags1(c, carry, depth + 1); + FIFORevQueue q = carryFlags1(p, carry, depth + 1); if (q != null) return defer(q, carry, pList, i + 1); } -- cgit v1.2.3