mirror of
https://github.com/sourcegit-scm/sourcegit
synced 2025-05-21 04:04:59 +00:00
fix: avoid duplicated nodes being added into the repository tree
This commit is contained in:
parent
207e82b391
commit
eeb6abb560
4 changed files with 27 additions and 28 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue