From 3e18e76d31939d1798c3d66427e47f71487d4736 Mon Sep 17 00:00:00 2001 From: Guy Pursey Date: Sun, 15 Oct 2023 13:34:27 +0100 Subject: [PATCH] GitGraph: removed check of branch with main from arrow reroute fn Checking if branch was same as main turned out to be redundant for now, since there don't seem to be any cases where routing curves into main. This fixes issue found in review by @nirname and avoids a situation where branching from the same commit results in unnecessary rerouting. --- packages/mermaid/src/diagrams/git/gitGraphRenderer.js | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/packages/mermaid/src/diagrams/git/gitGraphRenderer.js b/packages/mermaid/src/diagrams/git/gitGraphRenderer.js index 96dba5a6b..55f291c93 100644 --- a/packages/mermaid/src/diagrams/git/gitGraphRenderer.js +++ b/packages/mermaid/src/diagrams/git/gitGraphRenderer.js @@ -358,9 +358,8 @@ const drawCommits = (svg, commits, modifyGraph) => { const shouldRerouteArrow = (commitA, commitB, allCommits) => { const isOnSourceBranch = (x) => x.branch === commitA.branch; const isBetweenCommits = (x) => x.seq > commitA.seq && x.seq < commitB.seq; - const sourceIsMain = commitA.branch === getConfig().gitGraph.mainBranchName; return Object.values(allCommits).some((commitX) => { - return isBetweenCommits(commitX) && (sourceIsMain || isOnSourceBranch(commitX)); + return isBetweenCommits(commitX) && isOnSourceBranch(commitX); }); };