mirror of
https://github.com/sourcegit-scm/sourcegit
synced 2025-06-05 11:05:00 +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;
|
var localPath = url;
|
||||||
if (url.StartsWith("file://", StringComparison.Ordinal))
|
if (OperatingSystem.IsWindows())
|
||||||
localPath = url.Substring(7);
|
{
|
||||||
|
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);
|
return Directory.Exists(localPath);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue