mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-09-24 17:59:39 +02:00
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.
This commit is contained in:
@@ -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);
|
||||
});
|
||||
};
|
||||
|
||||
|
Reference in New Issue
Block a user