mirror of
https://github.com/sourcegit-scm/sourcegit
synced 2025-05-21 20:24:59 +00:00
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:
parent
0dea7ed0e2
commit
b556feb3d3
11 changed files with 122 additions and 42 deletions
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue