mirror of
https://github.com/sourcegit-scm/sourcegit.git
synced 2024-12-24 20:57:19 -08: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}";
|
Args = $"tag --delete {name}";
|
||||||
if (!Exec()) return false;
|
if (!Exec()) return false;
|
||||||
|
|
||||||
|
var repo = Models.Preference.Instance.FindRepository(Cwd);
|
||||||
|
if (repo != null && repo.Filters.Contains(name)) {
|
||||||
|
repo.Filters.Remove(name);
|
||||||
|
}
|
||||||
|
|
||||||
if (push) {
|
if (push) {
|
||||||
var remotes = new Remotes(Cwd).Result();
|
var remotes = new Remotes(Cwd).Result();
|
||||||
foreach (var r in remotes) {
|
foreach (var r in remotes) {
|
||||||
|
|
|
@ -27,11 +27,21 @@ namespace SourceGit.Views.Popups {
|
||||||
public override Task<bool> Start() {
|
public override Task<bool> Start() {
|
||||||
return Task.Run(() => {
|
return Task.Run(() => {
|
||||||
Models.Watcher.SetEnabled(repo, false);
|
Models.Watcher.SetEnabled(repo, false);
|
||||||
|
|
||||||
|
var full = branch;
|
||||||
if (string.IsNullOrEmpty(remote)) {
|
if (string.IsNullOrEmpty(remote)) {
|
||||||
|
full = $"refs/heads/{branch}";
|
||||||
new Commands.Branch(repo, branch).Delete();
|
new Commands.Branch(repo, branch).Delete();
|
||||||
} else {
|
} else {
|
||||||
|
full = $"refs/remotes/{remote}/{branch}";
|
||||||
new Commands.Push(repo, remote, branch).Exec();
|
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);
|
Models.Watcher.SetEnabled(repo, true);
|
||||||
return true;
|
return true;
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in a new issue