@@ -200,21 +200,10 @@ def __call__(self) -> None: # noqa: C901
200
200
scheme = self .scheme ,
201
201
)
202
202
203
- is_initial = self .is_initial_tag (current_tag_version , is_yes )
204
- if is_initial :
205
- commits = git .get_commits ()
206
- else :
207
- commits = git .get_commits (current_tag_version )
208
-
209
203
# If user specified changelog_to_stdout, they probably want the
210
204
# changelog to be generated as well, this is the most intuitive solution
211
205
self .changelog = self .changelog or bool (self .changelog_to_stdout )
212
206
213
- # No commits, there is no need to create an empty tag.
214
- # Unless we previously had a prerelease.
215
- if not commits and not current_version .is_prerelease :
216
- raise NoCommitsFoundError ("[NO_COMMITS_FOUND]\n " "No new commits found." )
217
-
218
207
if manual_version :
219
208
try :
220
209
new_version = self .scheme (manual_version )
@@ -225,6 +214,19 @@ def __call__(self) -> None: # noqa: C901
225
214
) from exc
226
215
else :
227
216
if increment is None :
217
+ is_initial = self .is_initial_tag (current_tag_version , is_yes )
218
+ if is_initial :
219
+ commits = git .get_commits ()
220
+ else :
221
+ commits = git .get_commits (current_tag_version )
222
+
223
+ # No commits, there is no need to create an empty tag.
224
+ # Unless we previously had a prerelease.
225
+ if not commits and not current_version .is_prerelease :
226
+ raise NoCommitsFoundError (
227
+ "[NO_COMMITS_FOUND]\n " "No new commits found."
228
+ )
229
+
228
230
increment = self .find_increment (commits )
229
231
230
232
# It may happen that there are commits, but they are not eligible
0 commit comments