mirror of
https://github.com/sourcegit-scm/sourcegit.git
synced 2024-11-01 13:13:21 -07:00
fix<Filters>: remove from filters after a branch or tag deleted
This commit is contained in:
parent
16b324424c
commit
36b5c7b809
2 changed files with 15 additions and 0 deletions
|
@ -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) {
|
||||
|
|
|
@ -27,11 +27,21 @@ namespace SourceGit.Views.Popups {
|
|||
public override Task<bool> 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;
|
||||
});
|
||||
|
|
Loading…
Reference in a new issue