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

@ -22,6 +22,12 @@ namespace SourceGit.ViewModels
set;
}
public bool PushAllRemotes
{
get => _pushAllRemotes;
set => SetProperty(ref _pushAllRemotes, value);
}
public PushTag(Repository repo, Models.Tag target)
{
_repo = repo;
@ -37,12 +43,27 @@ namespace SourceGit.ViewModels
return Task.Run(() =>
{
var succ = new Commands.Push(_repo.FullPath, SelectedRemote.Name, Target.Name, false).Exec();
bool succ = true;
if (_pushAllRemotes)
{
foreach (var remote in _repo.Remotes)
{
succ = new Commands.Push(_repo.FullPath, remote.Name, Target.Name, false).Exec();
if (!succ)
break;
}
}
else
{
succ = new Commands.Push(_repo.FullPath, SelectedRemote.Name, Target.Name, false).Exec();
}
CallUIThread(() => _repo.SetWatcherEnabled(true));
return succ;
});
}
private readonly Repository _repo = null;
private bool _pushAllRemotes = false;
}
}