mirror of
https://github.com/sourcegit-scm/sourcegit
synced 2025-05-23 21:24:59 +00:00
enhance: tag push behavior while creating and deleting (#999)
- Remember the state of `Push to all remotes after created` checkbox while creating tag - Remember the state of `Delete from remote repositories` checkbox while deleting tag - Change default state of `Delete from remote repositories` to `false` Signed-off-by: leo <longshuang@msn.cn>
This commit is contained in:
parent
5d2cd8b2fa
commit
59638eb731
5 changed files with 25 additions and 13 deletions
|
@ -39,11 +39,11 @@ namespace SourceGit.ViewModels
|
|||
set;
|
||||
} = false;
|
||||
|
||||
public bool PushToAllRemotes
|
||||
public bool PushToRemotes
|
||||
{
|
||||
get;
|
||||
set;
|
||||
} = true;
|
||||
get => _repo.Settings.PushToRemoteWhenCreateTag;
|
||||
set => _repo.Settings.PushToRemoteWhenCreateTag = value;
|
||||
}
|
||||
|
||||
public CreateTag(Repository repo, Models.Branch branch)
|
||||
{
|
||||
|
@ -82,6 +82,7 @@ namespace SourceGit.ViewModels
|
|||
_repo.SetWatcherEnabled(false);
|
||||
ProgressDescription = "Create tag...";
|
||||
|
||||
var remotes = PushToRemotes ? _repo.Remotes : null;
|
||||
return Task.Run(() =>
|
||||
{
|
||||
bool succ;
|
||||
|
@ -90,9 +91,9 @@ namespace SourceGit.ViewModels
|
|||
else
|
||||
succ = Commands.Tag.Add(_repo.FullPath, _tagName, _basedOn);
|
||||
|
||||
if (succ && PushToAllRemotes)
|
||||
if (succ && remotes != null)
|
||||
{
|
||||
foreach (var remote in _repo.Remotes)
|
||||
foreach (var remote in remotes)
|
||||
{
|
||||
SetProgressDescription($"Pushing tag to remote {remote.Name} ...");
|
||||
new Commands.Push(_repo.FullPath, remote.Name, _tagName, false).Exec();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue