summaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit
diff options
context:
space:
mode:
authorRobin Rosenberg <robin.rosenberg@dewire.com>2012-08-05 06:51:27 -0400
committerGerrit Code Review @ Eclipse.org <gerrit@eclipse.org>2012-08-05 06:51:27 -0400
commitd08b35532a2403b0f1b2dbb68436cfa68d2b924a (patch)
tree6cb4156639521c44e9ab8d81b45008a1595de2b4 /org.eclipse.jgit
parent7c1e175de8ca26b572816204c7ac7bb9ce49678f (diff)
parentb2f911bb69c9ac1b644809f98b6e5a36581e9ad8 (diff)
downloadjgit-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.java10
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;