mirror of
https://fastgit.cc/github.com/sourcegit-scm/sourcegit
synced 2026-04-22 13:51:15 +08:00
fix: try to avoid asking ssh passphrase every time while communicating with remote (#1577)
Signed-off-by: leo <longshuang@msn.cn>
This commit is contained in:
@@ -176,8 +176,10 @@ namespace SourceGit.Commands
|
||||
// Force using this app as SSH askpass program
|
||||
var selfExecFile = Process.GetCurrentProcess().MainModule!.FileName;
|
||||
start.Environment.Add("SSH_ASKPASS", selfExecFile); // Can not use parameter here, because it invoked by SSH with `exec`
|
||||
start.Environment.Add("SSH_ASKPASS_REQUIRE", "force");
|
||||
start.Environment.Add("SSH_ASKPASS_REQUIRE", "prefer");
|
||||
start.Environment.Add("SOURCEGIT_LAUNCH_AS_ASKPASS", "TRUE");
|
||||
if (!OperatingSystem.IsLinux())
|
||||
start.Environment.Add("DISPLAY", "required");
|
||||
|
||||
// If an SSH private key was provided, sets the environment.
|
||||
if (!start.Environment.ContainsKey("GIT_SSH_COMMAND") && !string.IsNullOrEmpty(SSHKey))
|
||||
|
||||
Reference in New Issue
Block a user