@@ -135,37 +135,13 @@ def test_returns_commit_and_tag_info(self, git_repo: Path) -> None:
135
135
tag_info = scm .Git .latest_tag_info (tag_name , parse_pattern = parse_pattern )
136
136
assert tag_info .commit_sha is not None
137
137
assert tag_info .current_version == "0.1.0"
138
+ assert tag_info .current_tag == f"{ tag_prefix } 0.1.0"
138
139
assert tag_info .distance_to_latest_tag == 0
139
140
assert tag_info .branch_name == "master"
140
141
assert tag_info .short_branch_name == "master"
141
142
assert tag_info .repository_root == git_repo
142
143
assert tag_info .dirty is False
143
144
144
- def test_git_latest_tag_info (self , git_repo : Path ) -> None :
145
- """Should return information about the latest tag."""
146
- readme = git_repo .joinpath ("readme.md" )
147
- readme .touch ()
148
- tag_prefix = "app/"
149
- parse_pattern = r"(?P<major>\d+)\.(?P<minor>\d+)\.(?P<patch>\d+)"
150
- tag_name = f"{ tag_prefix } {{new_version}}"
151
- with inside_dir (git_repo ):
152
- # Add a file and tag
153
- subprocess .run (["git" , "add" , "readme.md" ])
154
- subprocess .run (["git" , "commit" , "-m" , "first" ])
155
- subprocess .run (["git" , "tag" , f"{ tag_prefix } 0.1.0" ])
156
-
157
- # Make it dirty
158
- git_repo .joinpath ("something.md" ).touch ()
159
- subprocess .run (["git" , "add" , "something.md" ])
160
- tag_info = scm .Git .latest_tag_info (tag_name , parse_pattern = parse_pattern )
161
- assert tag_info .commit_sha is not None
162
- assert tag_info .current_version == "0.1.0"
163
- assert tag_info .distance_to_latest_tag == 0
164
- assert tag_info .branch_name == "master"
165
- assert tag_info .short_branch_name == "master"
166
- assert tag_info .repository_root == git_repo
167
- assert tag_info .dirty is True
168
-
169
145
170
146
def test_git_detects_existing_tag (git_repo : Path , caplog : LogCaptureFixture ) -> None :
171
147
"""Attempting to tag when a tag exists will do nothing."""
0 commit comments