mirror of
https://github.com/sourcegit-scm/sourcegit
synced 2025-05-23 05:05:00 +00:00
feature: add a button to switch tag sort method (creatordate/name asc/name des) (#865)
This commit is contained in:
parent
84721a7258
commit
08a128cd87
9 changed files with 112 additions and 6 deletions
|
@ -11,7 +11,7 @@ namespace SourceGit.Commands
|
|||
|
||||
Context = repo;
|
||||
WorkingDirectory = repo;
|
||||
Args = $"tag -l --sort=-creatordate --format=\"{_boundary}%(refname)%00%(objectname)%00%(*objectname)%00%(contents:subject)%0a%0a%(contents:body)\"";
|
||||
Args = $"tag -l --format=\"{_boundary}%(refname)%00%(objectname)%00%(*objectname)%00%(creatordate:unix)%00%(contents:subject)%0a%0a%(contents:body)\"";
|
||||
}
|
||||
|
||||
public List<Models.Tag> Result()
|
||||
|
@ -25,14 +25,15 @@ namespace SourceGit.Commands
|
|||
foreach (var record in records)
|
||||
{
|
||||
var subs = record.Split('\0', StringSplitOptions.None);
|
||||
if (subs.Length != 4)
|
||||
if (subs.Length != 5)
|
||||
continue;
|
||||
|
||||
var message = subs[3].Trim();
|
||||
var message = subs[4].Trim();
|
||||
tags.Add(new Models.Tag()
|
||||
{
|
||||
Name = subs[0].Substring(10),
|
||||
SHA = string.IsNullOrEmpty(subs[2]) ? subs[1] : subs[2],
|
||||
CreatorDate = ulong.Parse(subs[3]),
|
||||
Message = string.IsNullOrEmpty(message) ? null : message,
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue