mirror of
https://github.com/sourcegit-scm/sourcegit
synced 2025-05-22 20:54:59 +00:00
refactor: rewrite the histories filter function to supports both include
and exclude
modes (#690)
Signed-off-by: leo <longshuang@msn.cn>
This commit is contained in:
parent
e3ffe3ef6c
commit
ca5bc4b4df
27 changed files with 767 additions and 309 deletions
|
@ -1,4 +1,5 @@
|
|||
using System.ComponentModel.DataAnnotations;
|
||||
using System;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace SourceGit.ViewModels
|
||||
|
@ -57,10 +58,17 @@ namespace SourceGit.ViewModels
|
|||
var succ = Commands.Branch.Rename(_repo.FullPath, Target.Name, _name);
|
||||
CallUIThread(() =>
|
||||
{
|
||||
if (succ && _repo.Settings.Filters.Contains(oldName))
|
||||
if (succ)
|
||||
{
|
||||
_repo.Settings.Filters.Remove(oldName);
|
||||
_repo.Settings.Filters.Add($"refs/heads/{_name}");
|
||||
foreach (var filter in _repo.Settings.HistoriesFilters)
|
||||
{
|
||||
if (filter.Type == Models.FilterType.LocalBranch &&
|
||||
filter.Pattern.Equals(oldName, StringComparison.Ordinal))
|
||||
{
|
||||
filter.Pattern = $"refs/heads/{_name}";
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
_repo.MarkBranchesDirtyManually();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue