Skip to content

Commit aefaeac

Browse files
Draw second parent-child arrow when possible for ff merges with --no-ff merge commit
Signed-off-by: Jacob Stopak <jacob@initialcommit.io>
1 parent 45e8ef0 commit aefaeac

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

git_sim/merge.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,14 @@ def construct(self):
7474
if self.no_ff:
7575
self.center_frame_on_commit(branch_commit)
7676
commitId = self.setup_and_draw_parent(branch_commit, "Merge commit")
77+
78+
# If pre-merge HEAD is on screen, drawn an arrow to it as 2nd parent
79+
if head_commit.hexsha in self.drawnCommits:
80+
start = self.drawnCommits["abcdef"].get_center()
81+
end = self.drawnCommits[head_commit.hexsha].get_center()
82+
arrow = m.CurvedArrow(start, end, color=self.fontColor)
83+
self.draw_arrow(True, arrow)
84+
7785
reset_head_to = "abcdef"
7886
shift = numpy.array([0.0, 0.0, 0.0])
7987

0 commit comments

Comments
 (0)