diff --git a/src/Commands/Tag.cs b/src/Commands/Tag.cs index 88942878..e3ad4821 100644 --- a/src/Commands/Tag.cs +++ b/src/Commands/Tag.cs @@ -29,6 +29,11 @@ namespace SourceGit.Commands { Args = $"tag --delete {name}"; if (!Exec()) return false; + var repo = Models.Preference.Instance.FindRepository(Cwd); + if (repo != null && repo.Filters.Contains(name)) { + repo.Filters.Remove(name); + } + if (push) { var remotes = new Remotes(Cwd).Result(); foreach (var r in remotes) { diff --git a/src/Views/Popups/DeleteBranch.xaml.cs b/src/Views/Popups/DeleteBranch.xaml.cs index 248a7e82..3577d63f 100644 --- a/src/Views/Popups/DeleteBranch.xaml.cs +++ b/src/Views/Popups/DeleteBranch.xaml.cs @@ -27,11 +27,21 @@ namespace SourceGit.Views.Popups { public override Task Start() { return Task.Run(() => { Models.Watcher.SetEnabled(repo, false); + + var full = branch; if (string.IsNullOrEmpty(remote)) { + full = $"refs/heads/{branch}"; new Commands.Branch(repo, branch).Delete(); } else { + full = $"refs/remotes/{remote}/{branch}"; new Commands.Push(repo, remote, branch).Exec(); } + + var exists = Models.Preference.Instance.FindRepository(repo); + if (exists != null && exists.Filters.Contains(full)) { + exists.Filters.Remove(full); + } + Models.Watcher.SetEnabled(repo, true); return true; });