From fc43edb6d20f404000d9b2bf4b63110926413288 Mon Sep 17 00:00:00 2001 From: leo Date: Wed, 23 Aug 2023 16:45:45 +0800 Subject: [PATCH] fix: fix parse repository's SSH URL --- src/Views/Clone.xaml.cs | 2 +- src/Views/Validations/GitURL.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Views/Clone.xaml.cs b/src/Views/Clone.xaml.cs index abc66330..bac20bfa 100644 --- a/src/Views/Clone.xaml.cs +++ b/src/Views/Clone.xaml.cs @@ -14,7 +14,7 @@ namespace SourceGit.Views { /// public partial class Clone : Controls.Window { private static readonly Regex[] SSH_PROTOCOAL = new Regex[] { - new Regex(@"[\w\-]+@[\w\.\-]+(\:[0-9]+)?/[\w\-]+/[\w\-]+\.git$"), + new Regex(@"^[\w\-]+@[\w\.\-]+(\:[0-9]+)?:[\w\-]+/[\w\-]+\.git$"), new Regex(@"^ssh://([\w\-]+@)?[\w\.\-]+(\:[0-9]+)?/[\w\-]+/[\w\-]+\.git$"), }; diff --git a/src/Views/Validations/GitURL.cs b/src/Views/Validations/GitURL.cs index ea13e198..b726265b 100644 --- a/src/Views/Validations/GitURL.cs +++ b/src/Views/Validations/GitURL.cs @@ -7,7 +7,7 @@ namespace SourceGit.Views.Validations { public class GitURL : ValidationRule { private static readonly Regex[] VALID_FORMATS = new Regex[] { new Regex(@"^http[s]?://[\w\.\-]+(\:[0-9]+)?/[\w\-]+/[\w\-]+\.git$"), - new Regex(@"[\w\-]+@[\w\.\-]+(\:[0-9]+)?/[\w\-]+/[\w\-]+\.git$"), + new Regex(@"^[\w\-]+@[\w\.\-]+(\:[0-9]+)?:[\w\-]+/[\w\-]+\.git$"), new Regex(@"^ssh://([\w\-]+@)?[\w\.\-]+(\:[0-9]+)?/[\w\-]+/[\w\-]+\.git$"), };