From 8e60ec619eec862d21c4477c0236b861232300b2 Mon Sep 17 00:00:00 2001 From: leo Date: Wed, 24 Jul 2024 18:52:12 +0800 Subject: [PATCH] fix: `%(refname:short)` sometimes return a wrong tag name that contains the prefix `tags/` --- src/Commands/QueryTags.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Commands/QueryTags.cs b/src/Commands/QueryTags.cs index f17b7896..2abbe277 100644 --- a/src/Commands/QueryTags.cs +++ b/src/Commands/QueryTags.cs @@ -9,7 +9,7 @@ namespace SourceGit.Commands { Context = repo; WorkingDirectory = repo; - Args = "for-each-ref --sort=-creatordate --format=\"$%(refname:short)$%(objectname)$%(*objectname)\" refs/tags"; + Args = "tag -l --sort=-creatordate --format=\"$%(refname)$%(objectname)$%(*objectname)\""; } public List Result() @@ -25,7 +25,7 @@ namespace SourceGit.Commands { _loaded.Add(new Models.Tag() { - Name = subs[0], + Name = subs[0].Substring(10), SHA = subs[1], }); } @@ -33,7 +33,7 @@ namespace SourceGit.Commands { _loaded.Add(new Models.Tag() { - Name = subs[0], + Name = subs[0].Substring(10), SHA = subs[2], }); }