mirror of
https://github.com/sourcegit-scm/sourcegit
synced 2025-06-03 10:04:59 +00:00
fix: on Windows, the correct file protocol url format is file:///<driver>:/path/to/file_or_dir
(#1339)
Signed-off-by: leo <longshuang@msn.cn>
This commit is contained in:
parent
0a6b1faa65
commit
3232e6f313
1 changed files with 10 additions and 2 deletions
|
@ -51,8 +51,16 @@ namespace SourceGit.Models
|
|||
}
|
||||
|
||||
var localPath = url;
|
||||
if (url.StartsWith("file://", StringComparison.Ordinal))
|
||||
localPath = url.Substring(7);
|
||||
if (OperatingSystem.IsWindows())
|
||||
{
|
||||
if (url.StartsWith("file:///", StringComparison.Ordinal))
|
||||
localPath = url.Substring(8);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (url.StartsWith("file://", StringComparison.Ordinal))
|
||||
localPath = url.Substring(7);
|
||||
}
|
||||
|
||||
return Directory.Exists(localPath);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue