From 95ec6e723cc02ee8c429dde87154dd220f3a4fd7 Mon Sep 17 00:00:00 2001 From: Nathan Baulch Date: Mon, 7 Jul 2025 12:43:44 +1000 Subject: [PATCH] fix: deadlock on `ctrl+N` (#1531) --- src/ViewModels/Clone.cs | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/src/ViewModels/Clone.cs b/src/ViewModels/Clone.cs index 6a236ac5..dbb618ec 100644 --- a/src/ViewModels/Clone.cs +++ b/src/ViewModels/Clone.cs @@ -66,16 +66,19 @@ namespace SourceGit.ViewModels if (string.IsNullOrEmpty(ParentFolder)) _parentFolder = Preferences.Instance.GitDefaultCloneDir; - try + Task.Run(async () => { - var text = App.GetClipboardTextAsync().Result; - if (Models.Remote.IsValidURL(text)) - Remote = text; - } - catch - { - // Ignore - } + try + { + var text = await App.GetClipboardTextAsync(); + if (Models.Remote.IsValidURL(text)) + Remote = text; + } + catch + { + // Ignore + } + }); } public static ValidationResult ValidateRemote(string remote, ValidationContext _)