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:
Guy Pursey 2023-10-15 13:34:27 +01:00
parent 3ba33c8b75
commit 3e18e76d31

View File

@ -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);
});
};