From 089f24b0d2f96d017215496276c0d0dd3e38cb34 Mon Sep 17 00:00:00 2001 From: leo Date: Fri, 30 Aug 2024 16:59:25 +0800 Subject: [PATCH] fix: can not create subgroups (#427) --- src/ViewModels/ScanRepositories.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/ViewModels/ScanRepositories.cs b/src/ViewModels/ScanRepositories.cs index b6013adc..a7a9ab7b 100644 --- a/src/ViewModels/ScanRepositories.cs +++ b/src/ViewModels/ScanRepositories.cs @@ -46,7 +46,8 @@ namespace SourceGit.ViewModels foreach (var f in founded) { - var relative = Path.GetDirectoryName(f).Substring(prefixLen); + var fullpath = new DirectoryInfo(f); + var relative = fullpath.Parent!.FullName.Replace("\\", "/").Substring(prefixLen); var group = FindOrCreateGroupRecursive(Preference.Instance.RepositoryNodes, relative); Preference.Instance.FindOrAddNodeByRepositoryPath(f, group, false); }