mirror of
https://github.com/sourcegit-scm/sourcegit.git
synced 2024-12-23 20:47:25 -08:00
enhance: update filters after a filtered branch renamed (#536)
This commit is contained in:
parent
4e57cd50cd
commit
6fe7dfad7f
2 changed files with 16 additions and 3 deletions
|
@ -8,7 +8,6 @@ namespace SourceGit.ViewModels
|
|||
public Models.Branch Target
|
||||
{
|
||||
get;
|
||||
private set;
|
||||
}
|
||||
|
||||
[Required(ErrorMessage = "Branch name is required!!!")]
|
||||
|
@ -54,8 +53,19 @@ namespace SourceGit.ViewModels
|
|||
|
||||
return Task.Run(() =>
|
||||
{
|
||||
var oldName = Target.FullName;
|
||||
var succ = Commands.Branch.Rename(_repo.FullPath, Target.Name, _name);
|
||||
CallUIThread(() => _repo.SetWatcherEnabled(true));
|
||||
CallUIThread(() =>
|
||||
{
|
||||
if (succ && _repo.Settings.Filters.Contains(oldName))
|
||||
{
|
||||
_repo.Settings.Filters.Remove(oldName);
|
||||
_repo.Settings.Filters.Add($"refs/heads/{_name}");
|
||||
}
|
||||
|
||||
_repo.MarkBranchesDirtyManually();
|
||||
_repo.SetWatcherEnabled(true);
|
||||
});
|
||||
return succ;
|
||||
});
|
||||
}
|
||||
|
|
|
@ -841,7 +841,7 @@ namespace SourceGit.ViewModels
|
|||
|
||||
if (_settings.Filters.Count != validFilters.Count)
|
||||
{
|
||||
Dispatcher.UIThread.Post(() =>
|
||||
Dispatcher.UIThread.Invoke(() =>
|
||||
{
|
||||
_settings.Filters.Clear();
|
||||
_settings.Filters.AddRange(validFilters);
|
||||
|
@ -850,6 +850,9 @@ namespace SourceGit.ViewModels
|
|||
}
|
||||
else
|
||||
{
|
||||
if (_settings.Filters.Count != 0)
|
||||
Dispatcher.UIThread.Invoke(() => _settings.Filters.Clear());
|
||||
|
||||
limits += "--exclude=refs/stash --all";
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue