mirror of
https://github.com/sourcegit-scm/sourcegit
synced 2025-06-02 01:34:58 +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
|
@ -10,17 +10,16 @@ namespace SourceGit.ViewModels
|
|||
private set;
|
||||
}
|
||||
|
||||
public bool ShouldPushToRemote
|
||||
public bool PushToRemotes
|
||||
{
|
||||
get;
|
||||
set;
|
||||
get => _repo.Settings.PushToRemoteWhenDeleteTag;
|
||||
set => _repo.Settings.PushToRemoteWhenDeleteTag = value;
|
||||
}
|
||||
|
||||
public DeleteTag(Repository repo, Models.Tag tag)
|
||||
{
|
||||
_repo = repo;
|
||||
Target = tag;
|
||||
ShouldPushToRemote = true;
|
||||
View = new Views.DeleteTag() { DataContext = this };
|
||||
}
|
||||
|
||||
|
@ -29,9 +28,9 @@ namespace SourceGit.ViewModels
|
|||
_repo.SetWatcherEnabled(false);
|
||||
ProgressDescription = $"Deleting tag '{Target.Name}' ...";
|
||||
|
||||
var remotes = PushToRemotes ? _repo.Remotes : null;
|
||||
return Task.Run(() =>
|
||||
{
|
||||
var remotes = ShouldPushToRemote ? _repo.Remotes : null;
|
||||
var succ = Commands.Tag.Delete(_repo.FullPath, Target.Name, remotes);
|
||||
CallUIThread(() =>
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue