@@ -212,21 +212,10 @@ def __call__(self) -> None: # noqa: C901
212212 scheme = self .scheme ,
213213 )
214214
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-
221215 # If user specified changelog_to_stdout, they probably want the
222216 # changelog to be generated as well, this is the most intuitive solution
223217 self .changelog = self .changelog or bool (self .changelog_to_stdout )
224218
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-
230219 if manual_version :
231220 try :
232221 new_version = self .scheme (manual_version )
@@ -237,6 +226,19 @@ def __call__(self) -> None: # noqa: C901
237226 ) from exc
238227 else :
239228 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+
240242 increment = self .find_increment (commits )
241243
242244 # It may happen that there are commits, but they are not eligible
0 commit comments