refactor: move settings of repository, such as filters, commit message, from Preference to each repository's gitdir.

* avoid invalid repository setting remains in preference.json
* supports to restore tabs that not added to the Welcome page
This commit is contained in:
leo 2024-07-01 11:57:13 +08:00
parent 56a42dd6e8
commit 7f389b2e6f
No known key found for this signature in database
18 changed files with 187 additions and 209 deletions

View file

@ -253,11 +253,10 @@ namespace SourceGit.Views
return;
}
var gitDir = new Commands.QueryGitDir(root).Result();
Dispatcher.UIThread.Invoke(() =>
{
var repo = ViewModels.Preference.AddRepository(root, gitDir);
var node = ViewModels.Preference.FindOrAddNodeByRepositoryPath(repo.FullPath, parent, true);
var normalizedPath = root.Replace("\\", "/");
var node = ViewModels.Preference.FindOrAddNodeByRepositoryPath(normalizedPath, parent, true);
launcher.OpenRepositoryInTab(node, page);
});
});