Skip to content

Commit a2bc839

Browse files
Fix length of commit chain when creating dark commits
Signed-off-by: Jacob Stopak <jacob@initialcommit.io>
1 parent 683aa35 commit a2bc839

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

git_sim/git_sim_base_command.py

+5-2
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ def __init__(self):
2929
self.n_default = settings.n_default
3030
self.n = settings.n
3131
self.n_orig = self.n
32+
self.n_dark_commits = 0
3233
self.selected_branches = []
3334
self.zone_title_offset = 2.6 if platform.system() == "Windows" else 2.6
3435
self.arrow_map = []
@@ -143,7 +144,8 @@ def parse_commits(
143144
try:
144145
commitParents = list(commit.parents)
145146
except AttributeError:
146-
if len(self.drawnCommits) < self.n_default:
147+
if ((len(self.drawnCommits) + self.n_dark_commits) < self.n_default):
148+
self.n_dark_commits += 1
147149
self.parse_commits(self.create_dark_commit(), i, circle)
148150
return
149151

@@ -157,7 +159,8 @@ def parse_commits(
157159
for p in range(len(commitParents)):
158160
self.parse_commits(commitParents[p], i, circle)
159161
else:
160-
if len(self.drawnCommits) < self.n_default:
162+
if ((len(self.drawnCommits) + self.n_dark_commits) < self.n_default):
163+
self.n_dark_commits += 1
161164
self.parse_commits(self.create_dark_commit(), i, circle)
162165

163166
def parse_all(self):

0 commit comments

Comments
 (0)