refactor: rewrite Preference.FindOrAddNodeByRepositoryPath

* prevent moving node while opening repository directly from commandline
* supports to set parent node while dropping folder to initialize repository
This commit is contained in:
leo 2024-05-20 17:36:43 +08:00
parent 8d726656dc
commit faf2c39056
6 changed files with 15 additions and 12 deletions

View file

@ -113,7 +113,7 @@ namespace SourceGit.ViewModels
CallUIThread(() =>
{
var repo = Preference.AddRepository(path, Path.Combine(path, ".git"));
var node = Preference.FindOrAddNodeByRepositoryPath(repo.FullPath, null);
var node = Preference.FindOrAddNodeByRepositoryPath(repo.FullPath, null, true);
_launcher.OpenRepositoryInTab(node, _page);
});