From 84533599f1efc0d1a6d99aec668765dc26768dfe Mon Sep 17 00:00:00 2001 From: GadflyFang Date: Thu, 6 Feb 2025 10:22:01 +0800 Subject: [PATCH] fix: support encoded url in remote (#938) --- src/Models/Remote.cs | 4 ++-- src/Native/Windows.cs | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Models/Remote.cs b/src/Models/Remote.cs index 3c452460..dbe8cfa7 100644 --- a/src/Models/Remote.cs +++ b/src/Models/Remote.cs @@ -10,10 +10,10 @@ namespace SourceGit.Models private static partial Regex REG_HTTPS(); [GeneratedRegex(@"^[\w\-]+@[\w\.\-]+(\:[0-9]+)?:[\w\-/~%]+/[\w\-\.%]+(\.git)?$")] private static partial Regex REG_SSH1(); - [GeneratedRegex(@"^ssh://([\w\-]+@)?[\w\.\-]+(\:[0-9]+)?/[\w\-/~]+/[\w\-\.]+(\.git)?$")] + [GeneratedRegex(@"^ssh://([\w\-]+@)?[\w\.\-]+(\:[0-9]+)?/[\w\-/~%]+/[\w\-\.%]+(\.git)?$")] private static partial Regex REG_SSH2(); - [GeneratedRegex(@"^git@([\w\.\-]+):([\w\-/~]+/[\w\-\.]+)\.git$")] + [GeneratedRegex(@"^git@([\w\.\-]+):([\w\-/~%]+/[\w\-\.%]+)\.git$")] private static partial Regex REG_TO_VISIT_URL_CAPTURE(); private static readonly Regex[] URL_FORMATS = [ diff --git a/src/Native/Windows.cs b/src/Native/Windows.cs index 10f2970a..11b6bd13 100644 --- a/src/Native/Windows.cs +++ b/src/Native/Windows.cs @@ -152,7 +152,7 @@ namespace SourceGit.Native public void OpenBrowser(string url) { - var info = new ProcessStartInfo("cmd", $"/c start {url}"); + var info = new ProcessStartInfo("cmd", $"/c start \"\" \"{url}\""); info.CreateNoWindow = true; Process.Start(info); }