diff --git a/src/Models/CommitGraph.cs b/src/Models/CommitGraph.cs index 55746a43..1297a675 100644 --- a/src/Models/CommitGraph.cs +++ b/src/Models/CommitGraph.cs @@ -191,6 +191,7 @@ namespace SourceGit.Models } isMerged = isMerged || l.IsMerged; + major.IsMerged = isMerged; } else { @@ -202,12 +203,17 @@ namespace SourceGit.Models } // Create new curve for branch head - if (major == null && commit.Parents.Count > 0) + if (major == null) { offsetX += UNIT_WIDTH; - major = new PathHelper(commit.Parents[0], isMerged, colorIdx, new Point(offsetX, offsetY)); - unsolved.Add(major); - temp.Paths.Add(major.Path); + + if (commit.Parents.Count > 0) + { + major = new PathHelper(commit.Parents[0], isMerged, colorIdx, new Point(offsetX, offsetY)); + unsolved.Add(major); + temp.Paths.Add(major.Path); + } + colorIdx = (colorIdx + 1) % _penCount; } @@ -216,11 +222,9 @@ namespace SourceGit.Models int dotColor = 0; if (major != null) { - major.IsMerged = isMerged; position = new Point(major.LastX, offsetY); dotColor = major.Path.Color; } - Dot anchor = new Dot() { Center = position, Color = dotColor }; if (commit.IsCurrentHead) anchor.Type = DotType.Head;