diff --git a/src/Git/Repository.cs b/src/Git/Repository.cs index 4a602d5f..7203b6b5 100644 --- a/src/Git/Repository.cs +++ b/src/Git/Repository.cs @@ -390,7 +390,17 @@ namespace SourceGit.Git { if (nextUpdateTree > 0 && now >= nextUpdateTree) { nextUpdateTree = 0; - Branches(true); + + var branches = Branches(true); + var badFilters = new List(); + foreach (var filter in LogFilters) { + if (filter.StartsWith("refs/heads/") || filter.StartsWith("refs/remotes/")) { + var idx = branches.FindIndex(b => b.FullName == filter); + if (idx < 0) badFilters.Add(filter); + } + } + foreach (var bad in badFilters) LogFilters.Remove(bad); + OnBranchChanged?.Invoke(); OnCommitsChanged?.Invoke(); } diff --git a/src/Git/Tag.cs b/src/Git/Tag.cs index f329c4d4..fbfbf432 100644 --- a/src/Git/Tag.cs +++ b/src/Git/Tag.cs @@ -1,4 +1,4 @@ -using System.Collections.Generic; +using System.Collections.Generic; using System.IO; using System.Text.RegularExpressions; @@ -101,6 +101,7 @@ namespace SourceGit.Git { } } + repo.LogFilters.Remove(name); repo.OnCommitsChanged?.Invoke(); }