mirror of
https://fastgit.cc/github.com/sourcegit-scm/sourcegit
synced 2026-04-21 21:30:37 +08:00
refactor: rewrite Remote.IsValidURL (#1339)
Signed-off-by: leo <longshuang@msn.cn>
This commit is contained in:
@@ -50,19 +50,7 @@ namespace SourceGit.Models
|
||||
return true;
|
||||
}
|
||||
|
||||
var localPath = url;
|
||||
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);
|
||||
return url.StartsWith("file://", StringComparison.Ordinal) || Directory.Exists(url);
|
||||
}
|
||||
|
||||
public bool TryGetVisitURL(out string url)
|
||||
|
||||
Reference in New Issue
Block a user