File tree Expand file tree Collapse file tree 1 file changed +2
-14
lines changed Expand file tree Collapse file tree 1 file changed +2
-14
lines changed Original file line number Diff line number Diff line change @@ -318,20 +318,8 @@ def get_current_tags(context: Context) -> set[str]:
318318 log .error ("Cannot create a tag - there are uncommitted changes" )
319319 return set ()
320320
321- tags_per_commit : dict [str , list [str ]] = {}
322- for commit , tag in map (
323- str .split ,
324- context .run (
325- r"git for-each-ref --format '%(objectname) %(refname:short)' refs/tags" ,
326- hide = True ,
327- ).stdout .splitlines (),
328- ):
329- tags_per_commit .setdefault (commit , []).append (tag )
330-
331- current_commit = context .run (
332- "git rev-parse HEAD" , silent = True , external = True
333- ).stdout .strip ()
334- tags = set (tags_per_commit .get (current_commit , set ()))
321+ # get tags for current commit
322+ tags = set (context .run ("git tag --points-at HEAD" , hide = True ).stdout .splitlines ())
335323
336324 if not tags :
337325 log .error ("No tags found for current commit" )
You can’t perform that action at this time.
0 commit comments