We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 9c4bae4 commit e7f8161Copy full SHA for e7f8161
1 file changed
GitContentSearch.UI/ViewModels/MainWindowViewModel.cs
@@ -41,9 +41,11 @@ private async Task HandleFilePathLostFocusAsync()
41
try
42
{
43
var processWrapper = new ProcessWrapper();
44
- var absolutePath = Path.IsPathRooted(FilePath)
45
- ? FilePath
46
- : Path.GetFullPath(Path.Combine(WorkingDirectory, FilePath));
+ // Trim leading slash if present, as it's meant to be relative to the git repository
+ var normalizedPath = FilePath.TrimStart('/');
+ var absolutePath = Path.IsPathRooted(normalizedPath)
47
+ ? normalizedPath
48
+ : Path.GetFullPath(Path.Combine(WorkingDirectory, normalizedPath));
49
50
var directoryPath = Path.GetDirectoryName(absolutePath);
51
if (string.IsNullOrEmpty(directoryPath) || !Directory.Exists(directoryPath))
0 commit comments