fix: avoid duplicated nodes being added into the repository tree

This commit is contained in:
leo 2024-05-07 15:49:57 +08:00
parent 207e82b391
commit eeb6abb560
4 changed files with 27 additions and 28 deletions

View file

@ -28,18 +28,10 @@ namespace SourceGit.ViewModels
return false;
var gitDir = Path.GetFullPath(Path.Combine(_targetPath, ".git"));
CallUIThread(() =>
{
var repo = Preference.AddRepository(_targetPath, gitDir);
var node = new RepositoryNode()
{
Id = repo.FullPath,
Name = Path.GetFileName(repo.FullPath),
Bookmark = 0,
IsRepository = true,
};
Preference.AddNode(node);
Preference.FindOrAddNodeByRepositoryPath(repo.FullPath, null);
});
return true;