mirror of
https://github.com/sourcegit-scm/sourcegit
synced 2025-05-21 12:15:00 +00:00
enhance: histories filter
* set upstream branch using the same filter mode when change the filter mode of local branch * also excludes the decorators when current filter mode is excluding. Signed-off-by: leo <longshuang@msn.cn>
This commit is contained in:
parent
4796024483
commit
86d7541a7c
2 changed files with 8 additions and 22 deletions
|
@ -724,28 +724,8 @@ namespace SourceGit.ViewModels
|
|||
if (!changed)
|
||||
return;
|
||||
|
||||
if (isLocal && !string.IsNullOrEmpty(branch.Upstream) && mode != Models.FilterMode.Excluded)
|
||||
{
|
||||
var upstream = branch.Upstream;
|
||||
var canUpdateUpstream = true;
|
||||
foreach (var filter in _settings.HistoriesFilters)
|
||||
{
|
||||
bool matched = false;
|
||||
if (filter.Type == Models.FilterType.RemoteBranch)
|
||||
matched = filter.Pattern.Equals(upstream, StringComparison.Ordinal);
|
||||
else if (filter.Type == Models.FilterType.RemoteBranchFolder)
|
||||
matched = upstream.StartsWith(filter.Pattern, StringComparison.Ordinal);
|
||||
|
||||
if (matched && filter.Mode == Models.FilterMode.Excluded)
|
||||
{
|
||||
canUpdateUpstream = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (canUpdateUpstream)
|
||||
_settings.UpdateHistoriesFilter(upstream, Models.FilterType.RemoteBranch, mode);
|
||||
}
|
||||
if (isLocal && !string.IsNullOrEmpty(branch.Upstream))
|
||||
_settings.UpdateHistoriesFilter(branch.Upstream, Models.FilterType.RemoteBranch, mode);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue