mirror of
https://fastgit.cc/github.com/sourcegit-scm/sourcegit
synced 2026-04-24 02:40:24 +08:00
fix: wrong graph when there's only one commit
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user