diff options
author | Robin Rosenberg <robin.rosenberg@dewire.com> | 2012-08-05 06:51:27 -0400 |
---|---|---|
committer | Gerrit Code Review @ Eclipse.org <gerrit@eclipse.org> | 2012-08-05 06:51:27 -0400 |
commit | d08b35532a2403b0f1b2dbb68436cfa68d2b924a (patch) | |
tree | 6cb4156639521c44e9ab8d81b45008a1595de2b4 /org.eclipse.jgit | |
parent | 7c1e175de8ca26b572816204c7ac7bb9ce49678f (diff) | |
parent | b2f911bb69c9ac1b644809f98b6e5a36581e9ad8 (diff) | |
download | jgit-d08b35532a2403b0f1b2dbb68436cfa68d2b924a.tar.gz jgit-d08b35532a2403b0f1b2dbb68436cfa68d2b924a.zip |
Merge "Fix PlotCommit for commits with duplicate parents"
Diffstat (limited to 'org.eclipse.jgit')
-rw-r--r-- | org.eclipse.jgit/src/org/eclipse/jgit/revplot/PlotCommit.java | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/revplot/PlotCommit.java b/org.eclipse.jgit/src/org/eclipse/jgit/revplot/PlotCommit.java index 40e6aba11e..4a413c306a 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/revplot/PlotCommit.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/revplot/PlotCommit.java @@ -100,9 +100,13 @@ public class PlotCommit<L extends PlotLane> extends RevCommit { final int cnt = children.length; if (cnt == 0) children = new PlotCommit[] { c }; - else if (cnt == 1) - children = new PlotCommit[] { children[0], c }; - else { + else if (cnt == 1) { + if (!c.getId().equals(children[0].getId())) + children = new PlotCommit[] { children[0], c }; + } else { + for (PlotCommit pc : children) + if (c.getId().equals(pc.getId())) + return; final PlotCommit[] n = new PlotCommit[cnt + 1]; System.arraycopy(children, 0, n, 0, cnt); n[cnt] = c; |