diff --git a/src/git_changelog/commit.py b/src/git_changelog/commit.py index 70330aa..9390ecd 100644 --- a/src/git_changelog/commit.py +++ b/src/git_changelog/commit.py @@ -88,11 +88,11 @@ def __init__( tag = "" for ref in refs.split(","): - tag_ref = ref.strip() - if tag_ref.startswith("tag: "): - tag_ref = tag_ref.replace("tag: ", "") - if _is_semver(tag_ref): - tag = tag_ref + ref = ref.strip() # noqa: PLW2901 + if ref.startswith("tag: "): + ref = ref.replace("tag: ", "") # noqa: PLW2901 + if _is_semver(ref): + tag = ref break self.tag: str = tag self.version: str = tag