mirror of
https://github.com/sourcegit-scm/sourcegit.git
synced 2024-10-31 13:03:20 -07:00
fix: new window opened on failing fetch due to missing StrictHostKeyChecking=accept-new
for repo remote without private ssh key (#485)
This commit is contained in:
parent
bbd4012bc5
commit
6932ce44a9
2 changed files with 8 additions and 0 deletions
|
@ -521,6 +521,9 @@ namespace SourceGit
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
var param = args[0];
|
var param = args[0];
|
||||||
|
if (Directory.Exists(param))
|
||||||
|
return false;
|
||||||
|
|
||||||
if (!param.StartsWith("enter passphrase", StringComparison.OrdinalIgnoreCase) &&
|
if (!param.StartsWith("enter passphrase", StringComparison.OrdinalIgnoreCase) &&
|
||||||
!param.Contains(" password", StringComparison.OrdinalIgnoreCase))
|
!param.Contains(" password", StringComparison.OrdinalIgnoreCase))
|
||||||
return false;
|
return false;
|
||||||
|
|
|
@ -59,9 +59,14 @@ namespace SourceGit.Commands
|
||||||
|
|
||||||
// If an SSH private key was provided, sets the environment.
|
// If an SSH private key was provided, sets the environment.
|
||||||
if (!string.IsNullOrEmpty(SSHKey))
|
if (!string.IsNullOrEmpty(SSHKey))
|
||||||
|
{
|
||||||
start.Environment.Add("GIT_SSH_COMMAND", $"ssh -o StrictHostKeyChecking=accept-new -i '{SSHKey}'");
|
start.Environment.Add("GIT_SSH_COMMAND", $"ssh -o StrictHostKeyChecking=accept-new -i '{SSHKey}'");
|
||||||
|
}
|
||||||
else
|
else
|
||||||
|
{
|
||||||
|
start.Environment.Add("GIT_SSH_COMMAND", $"ssh -o StrictHostKeyChecking=accept-new");
|
||||||
start.Arguments += "-c credential.helper=manager ";
|
start.Arguments += "-c credential.helper=manager ";
|
||||||
|
}
|
||||||
|
|
||||||
// Force using en_US.UTF-8 locale to avoid GCM crash
|
// Force using en_US.UTF-8 locale to avoid GCM crash
|
||||||
if (OperatingSystem.IsLinux())
|
if (OperatingSystem.IsLinux())
|
||||||
|
|
Loading…
Reference in a new issue