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