Fix SCM history graph merge commit lines using wrong branch color#298590
Fix SCM history graph merge commit lines using wrong branch color#298590barruka wants to merge 1 commit intomicrosoft:mainfrom
Conversation
📬 CODENOTIFYThe following users are being notified based on files changed in this PR: @lszomoruMatched files:
|
There was a problem hiding this comment.
Pull request overview
This PR targets the SCM History graph rendering in VS Code’s Source Control workbench, aiming to address incorrect branch coloring for merge-commit connection lines.
Changes:
- Refactors the merge-parent path creation to introduce a
parentColorlocal variable before callingcreatePath(...).
| const parentColor = outputSwimlanes[parentOutputIndex].color; | ||
| const path = createPath(parentColor); |
There was a problem hiding this comment.
This change is a no-op for behavior: parentColor is just an alias for outputSwimlanes[parentOutputIndex].color, so the merge-parent path color selection is unchanged. Given the PR title about fixing wrong branch colors for merge commit lines, this likely doesn’t address the reported issue—please update the logic here to select the intended swimlane/color (or adjust the PR title/description if this was meant to be a refactor only).
Fixes #298588
Problem
In the Source Control history graph, when a merge commit has more than one parent, the lines connecting the merge node to its additional parents are drawn using \circleColor\ (the merge commit's own color) instead of the color of the target parent's swimlane.
This makes it impossible to visually trace branch colors through merge commits.
Root Cause
In
renderSCMHistoryItemGraph(scmHistory.ts), the// Add remaining parent(s)loop usescircleColorfor all paths:Fix
Use the color from the target parent's output swimlane entry instead:
outputSwimlanes[parentOutputIndex].colorholds the color that was already assigned to that specific parent branch when building the view model, so this single change is sufficient to propagate the correct color for each merged-in line.