File tree 1 file changed +9
-14
lines changed
1 file changed +9
-14
lines changed Original file line number Diff line number Diff line change @@ -318,20 +318,15 @@ def get_current_tags(context: Context) -> set[str]:
318
318
log .error ("Cannot create a tag - there are uncommitted changes" )
319
319
return set ()
320
320
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 = {
323
+ line
324
+ for line in map (
325
+ str .strip ,
326
+ context .run ("git tag --points-at HEAD" , hide = True ).stdout .splitlines (),
327
+ )
328
+ if line
329
+ }
335
330
336
331
if not tags :
337
332
log .error ("No tags found for current commit" )
You can’t perform that action at this time.
0 commit comments