mirror of
https://github.com/sourcegit-scm/sourcegit
synced 2025-06-05 11:05:00 +00:00
refactor: rewrite Remote.IsValidURL
(#1339)
Signed-off-by: leo <longshuang@msn.cn>
This commit is contained in:
parent
3232e6f313
commit
598ba6d9f6
1 changed files with 1 additions and 13 deletions
|
@ -50,19 +50,7 @@ namespace SourceGit.Models
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
var localPath = url;
|
return url.StartsWith("file://", StringComparison.Ordinal) || Directory.Exists(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);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool TryGetVisitURL(out string url)
|
public bool TryGetVisitURL(out string url)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue