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

@ -1,5 +1,4 @@
using System;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations;
using System.IO;
using System.Threading.Tasks;
@ -114,15 +113,7 @@ namespace SourceGit.ViewModels
CallUIThread(() =>
{
var repo = Preference.AddRepository(path, Path.Combine(path, ".git"));
var node = new RepositoryNode()
{
Id = repo.FullPath,
Name = Path.GetFileName(repo.FullPath),
Bookmark = 0,
IsRepository = true,
};
Preference.AddNode(node);
var node = Preference.FindOrAddNodeByRepositoryPath(repo.FullPath, null);
_launcher.OpenRepositoryInTab(node, _page);
});