Skip to content

Commit eaac208

Browse files
Fix bug causing extra dark commits to be drawn when -n is longer than displayed branch
Signed-off-by: Jacob Stopak <jacob@initialcommit.io>
1 parent aefaeac commit eaac208

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

git_sim/git_sim_base_command.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,8 @@ def parse_commits(
122122
try:
123123
commitParents = list(commit.parents)
124124
except AttributeError:
125-
self.parse_commits(self.create_dark_commit(), i, circle)
125+
if len(self.drawnCommits) < self.n_default:
126+
self.parse_commits(self.create_dark_commit(), i, circle)
126127
return
127128

128129
if len(commitParents) > 0:
@@ -135,7 +136,8 @@ def parse_commits(
135136
for p in range(len(commitParents)):
136137
self.parse_commits(commitParents[p], i, circle)
137138
else:
138-
self.parse_commits(self.create_dark_commit(), i, circle)
139+
if len(self.drawnCommits) < self.n_default:
140+
self.parse_commits(self.create_dark_commit(), i, circle)
139141

140142
def parse_all(self):
141143
if self.all:

0 commit comments

Comments
 (0)