mirror of
https://github.com/sourcegit-scm/sourcegit.git
synced 2025-01-11 23:57:21 -08:00
fix: new created branch expanded state is not remembered
This commit is contained in:
parent
68210d8a3e
commit
65e820e4d5
1 changed files with 7 additions and 2 deletions
|
@ -126,13 +126,18 @@ namespace SourceGit.ViewModels
|
|||
|
||||
CallUIThread(() =>
|
||||
{
|
||||
if (succ && CheckoutAfterCreated && _repo.HistoriesFilterMode == Models.FilterMode.Included)
|
||||
if (succ && CheckoutAfterCreated)
|
||||
{
|
||||
var fake = new Models.Branch() { IsLocal = true, FullName = $"refs/heads/{_name}" };
|
||||
if (BasedOn is Models.Branch based && !based.IsLocal)
|
||||
fake.Upstream = based.FullName;
|
||||
|
||||
_repo.SetBranchFilterMode(fake, Models.FilterMode.Included, true, false);
|
||||
var folderEndIdx = fake.FullName.LastIndexOf('/');
|
||||
if (folderEndIdx > 10)
|
||||
_repo.Settings.ExpandedBranchNodesInSideBar.Add(fake.FullName.Substring(0, folderEndIdx));
|
||||
|
||||
if (_repo.HistoriesFilterMode == Models.FilterMode.Included)
|
||||
_repo.SetBranchFilterMode(fake, Models.FilterMode.Included, true, false);
|
||||
}
|
||||
|
||||
_repo.MarkBranchesDirtyManually();
|
||||
|
|
Loading…
Reference in a new issue