mirror of
https://github.com/mermaid-js/mermaid.git
synced 2025-01-14 06:43:25 +08: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:
parent
3ba33c8b75
commit
3e18e76d31
@ -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);
|
||||
});
|
||||
};
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user