enhance: tag creation & pushing (#141)

* supports creating lightweight tags
* supports GPG signed tags
* add option to push selected tag to all remotes
This commit is contained in:
leo 2024-05-24 10:31:20 +08:00
parent 0dea7ed0e2
commit b556feb3d3
11 changed files with 122 additions and 42 deletions

View file

@ -5,12 +5,22 @@ namespace SourceGit.Commands
{
public static class Tag
{
public static bool Add(string repo, string name, string basedOn, string message)
public static bool Add(string repo, string name, string basedOn)
{
var cmd = new Command();
cmd.WorkingDirectory = repo;
cmd.Context = repo;
cmd.Args = $"tag -a {name} {basedOn} ";
cmd.Args = $"tag {name} {basedOn}";
return cmd.Exec();
}
public static bool Add(string repo, string name, string basedOn, string message, bool sign)
{
var param = sign ? "-s -a" : "-a";
var cmd = new Command();
cmd.WorkingDirectory = repo;
cmd.Context = repo;
cmd.Args = $"tag {param} {name} {basedOn} ";
if (!string.IsNullOrEmpty(message))
{