feature: auto-change filter branches after checkout (#855)

This commit is contained in:
leo 2025-01-02 14:10:10 +08:00
parent 2a55ba6d07
commit 127315528a
No known key found for this signature in database
2 changed files with 18 additions and 4 deletions

View file

@ -65,8 +65,14 @@ namespace SourceGit.ViewModels
{
var b = _repo.Branches.Find(x => x.IsLocal && x.Name == Branch);
if (b != null && _repo.HistoriesFilterMode == Models.FilterMode.Included)
{
_repo.Settings.HistoriesFilters.Clear();
_repo.Settings.UpdateHistoriesFilter(b.FullName, Models.FilterType.LocalBranch, Models.FilterMode.Included);
if (!string.IsNullOrEmpty(b.Upstream))
_repo.Settings.UpdateHistoriesFilter(b.Upstream, Models.FilterType.LocalBranch, Models.FilterMode.Included);
}
_repo.MarkBranchesDirtyManually();
_repo.SetWatcherEnabled(true);
});