fix: getting askpass for every action even when it's not necessary (#1577)

Signed-off-by: leo <longshuang@msn.cn>
This commit is contained in:
leo
2025-07-21 16:44:00 +08:00
parent 184ad00e19
commit 6822ae3e2e
7 changed files with 17 additions and 6 deletions

View File

@@ -172,7 +172,7 @@ namespace SourceGit.Commands
// If an SSH private key was provided, sets the environment.
if (!start.Environment.ContainsKey("GIT_SSH_COMMAND") && !string.IsNullOrEmpty(SSHKey))
start.Environment.Add("GIT_SSH_COMMAND", $"ssh -i '{SSHKey}'");
start.Environment.Add("GIT_SSH_COMMAND", $"ssh -o AddKeysToAgent=yes -i {SSHKey.Quoted()}");
// Force using en_US.UTF-8 locale
if (OperatingSystem.IsLinux())