Skip to content

Commit

Permalink
gitextensions#5125 RevisionGrid Graph: Nearest branch in tooltip (2b …
Browse files Browse the repository at this point in the history
…of 3)

Keep order of branches to make BranchFinder work correctly again
  • Loading branch information
mstv committed Oct 30, 2018
1 parent 7faab0b commit e77126f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
2 changes: 1 addition & 1 deletion GitUI/UserControls/RevisionGrid/Graph/LaneInfoProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ private bool FindBranch([NotNull] RevisionGraphRevision node)
/// </param>
private bool CheckForMerge([NotNull] RevisionGraphRevision node, [CanBeNull] RevisionGraphRevision parent)
{
bool isTheFirstBranch = parent == null || node.Parents.Count == 0 || node.Parents.First() == parent;
bool isTheFirstBranch = parent == null || node.StartSegments.Count == 0 || node.StartSegments.First().Parent == parent;
string mergedInto;
string mergedWith;
(mergedInto, mergedWith) = ParseMergeMessage(node.GitRevision.Subject, appendPullRequest: isTheFirstBranch);
Expand Down
10 changes: 3 additions & 7 deletions GitUI/UserControls/RevisionGrid/Graph/RevisionGraphRevision.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,6 @@ public RevisionGraphRevision(ObjectId objectId, int guessScore)
{
Objectid = objectId;

Parents = new ConcurrentBag<RevisionGraphRevision>();
Children = new ConcurrentBag<RevisionGraphRevision>();
StartSegments = new SynchronizedCollection<RevisionGraphSegment>();

Score = guessScore;

LaneColor = -1;
Expand Down Expand Up @@ -68,9 +64,9 @@ public int EnsureScoreIsAbove(int minimalScore)

public ObjectId Objectid { get; set; }

public ConcurrentBag<RevisionGraphRevision> Parents { get; private set; }
public ConcurrentBag<RevisionGraphRevision> Children { get; private set; }
public SynchronizedCollection<RevisionGraphSegment> StartSegments { get; private set; }
public ConcurrentBag<RevisionGraphRevision> Parents { get; private set; } = new ConcurrentBag<RevisionGraphRevision>();
public SynchronizedCollection<RevisionGraphRevision> Children { get; private set; } = new SynchronizedCollection<RevisionGraphRevision>();
public SynchronizedCollection<RevisionGraphSegment> StartSegments { get; private set; } = new SynchronizedCollection<RevisionGraphSegment>();

// Mark this commit, and all its parents, as relative. Used for branch highlighting.
// By default, the current checkout will be marked relative.
Expand Down

0 comments on commit e77126f

Please sign in to comment.