mirror of
https://fastgit.cc/github.com/sourcegit-scm/sourcegit
synced 2026-04-23 02:12:25 +08:00
feature: auto-remove history filter after deleting branch or tag (#1904)
Signed-off-by: leo <longshuang@msn.cn>
This commit is contained in:
@@ -141,6 +141,18 @@ namespace SourceGit.Models
|
||||
return FilterMode.None;
|
||||
}
|
||||
|
||||
public void RemoveFilter(string pattern, FilterType type)
|
||||
{
|
||||
foreach (var filter in Filters)
|
||||
{
|
||||
if (filter.Type == type && filter.Pattern.Equals(pattern, StringComparison.Ordinal))
|
||||
{
|
||||
Filters.Remove(filter);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void RemoveBranchFiltersByPrefix(string pattern)
|
||||
{
|
||||
var dirty = new List<HistoryFilter>();
|
||||
|
||||
@@ -55,10 +55,13 @@ namespace SourceGit.ViewModels
|
||||
|
||||
if (_alsoDeleteTrackingRemote && TrackingRemoteBranch != null)
|
||||
await DeleteRemoteBranchAsync(TrackingRemoteBranch, log);
|
||||
|
||||
_repo.HistoryFilterCollection.RemoveFilter(Target.FullName, Models.FilterType.LocalBranch);
|
||||
}
|
||||
else
|
||||
{
|
||||
await DeleteRemoteBranchAsync(Target, log);
|
||||
_repo.HistoryFilterCollection.RemoveFilter(Target.FullName, Models.FilterType.RemoteBranch);
|
||||
}
|
||||
|
||||
log.Complete();
|
||||
|
||||
@@ -44,6 +44,7 @@ namespace SourceGit.ViewModels
|
||||
}
|
||||
|
||||
log.Complete();
|
||||
_repo.HistoryFilterCollection.RemoveFilter(Target.Name, Models.FilterType.Tag);
|
||||
_repo.MarkTagsDirtyManually();
|
||||
return succ;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user