fix: ensure upstream branch exists before updating filter

This commit is contained in:
Gadfly 2025-05-13 17:57:54 +08:00
parent cf7b61dd71
commit 67b292ad86
No known key found for this signature in database

View file

@ -927,8 +927,12 @@ namespace SourceGit.ViewModels
return;
if (isLocal && !string.IsNullOrEmpty(branch.Upstream))
{
var upstreamNode = FindBranchNode(_remoteBranchTrees, branch.Upstream);
if (upstreamNode != null)
_settings.UpdateHistoriesFilter(branch.Upstream, Models.FilterType.RemoteBranch, mode);
}
}
else
{
var type = isLocal ? Models.FilterType.LocalBranchFolder : Models.FilterType.RemoteBranchFolder;