summaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit
diff options
context:
space:
mode:
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;