mirror of
https://fastgit.cc/github.com/sourcegit-scm/sourcegit
synced 2026-04-24 10:50:52 +08:00
fix<Dashboard>: update filters for commits when branch changed or tag deleted
This commit is contained in:
@@ -390,7 +390,17 @@ namespace SourceGit.Git {
|
||||
|
||||
if (nextUpdateTree > 0 && now >= nextUpdateTree) {
|
||||
nextUpdateTree = 0;
|
||||
Branches(true);
|
||||
|
||||
var branches = Branches(true);
|
||||
var badFilters = new List<string>();
|
||||
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();
|
||||
}
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user