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); }