From 2966e733f1908be81385277b8e62f36fd9f1cdf2 Mon Sep 17 00:00:00 2001 From: Matt Parker <61717342+MattParkerDev@users.noreply.github.com> Date: Sun, 2 Nov 2025 11:26:58 +1000 Subject: [PATCH] check for git repo first --- .../SolutionDiscovery/VsPersistence/VsPersistenceMapper.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/SharpIDE.Application/Features/SolutionDiscovery/VsPersistence/VsPersistenceMapper.cs b/src/SharpIDE.Application/Features/SolutionDiscovery/VsPersistence/VsPersistenceMapper.cs index f97c988..a91da93 100644 --- a/src/SharpIDE.Application/Features/SolutionDiscovery/VsPersistence/VsPersistenceMapper.cs +++ b/src/SharpIDE.Application/Features/SolutionDiscovery/VsPersistence/VsPersistenceMapper.cs @@ -12,7 +12,10 @@ public static class VsPersistenceMapper var intermediateModel = await IntermediateMapper.GetIntermediateModel(solutionFilePath, cancellationToken); var solutionModel = new SharpIdeSolutionModel(solutionFilePath, intermediateModel); - using var repo = new Repository(solutionModel.DirectoryPath); + + var gitFolderPath = Repository.Discover(solutionFilePath); + if (gitFolderPath is null) return solutionModel; + using var repo = new Repository(gitFolderPath); var status = repo.RetrieveStatus(new StatusOptions()); foreach (var entry in status.Where(s => s.State is not FileStatus.Ignored))