From 598ba6d9f68e0d6df8f487b634cc50ba861ac693 Mon Sep 17 00:00:00 2001 From: leo Date: Wed, 21 May 2025 14:48:21 +0800 Subject: [PATCH] refactor: rewrite `Remote.IsValidURL` (#1339) Signed-off-by: leo --- src/Models/Remote.cs | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/src/Models/Remote.cs b/src/Models/Remote.cs index 162c5aca..7e73012a 100644 --- a/src/Models/Remote.cs +++ b/src/Models/Remote.cs @@ -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)