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