File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed
GitContentSearch.UI/ViewModels Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -41,9 +41,11 @@ private async Task HandleFilePathLostFocusAsync()
4141 try
4242 {
4343 var processWrapper = new ProcessWrapper ( ) ;
44- var absolutePath = Path . IsPathRooted ( FilePath )
45- ? FilePath
46- : Path . GetFullPath ( Path . Combine ( WorkingDirectory , FilePath ) ) ;
44+ // Trim leading slash if present, as it's meant to be relative to the git repository
45+ var normalizedPath = FilePath . TrimStart ( '/' ) ;
46+ var absolutePath = Path . IsPathRooted ( normalizedPath )
47+ ? normalizedPath
48+ : Path . GetFullPath ( Path . Combine ( WorkingDirectory , normalizedPath ) ) ;
4749
4850 var directoryPath = Path . GetDirectoryName ( absolutePath ) ;
4951 if ( string . IsNullOrEmpty ( directoryPath ) || ! Directory . Exists ( directoryPath ) )
You can’t perform that action at this time.
0 commit comments