git: Use new SSH_GIT_COMMAND and get private key path from right location
This commit is contained in:
parent
c840050c78
commit
844a8e38bb
|
@ -49,10 +49,10 @@ namespace SparkleLib.Git {
|
|||
StartInfo.EnvironmentVariables.Add ("GIT_TERMINAL_PROMPT", "0");
|
||||
|
||||
if (!string.IsNullOrEmpty (SSHPath)) {
|
||||
if (StartInfo.EnvironmentVariables.ContainsKey ("GIT_SSH"))
|
||||
StartInfo.EnvironmentVariables ["GIT_SSH"] = SSHPath;
|
||||
if (StartInfo.EnvironmentVariables.ContainsKey ("GIT_SSH_COMMAND"))
|
||||
StartInfo.EnvironmentVariables ["GIT_SSH_COMMAND"] = SSHPath;
|
||||
else
|
||||
StartInfo.EnvironmentVariables.Add ("GIT_SSH", SSHPath);
|
||||
StartInfo.EnvironmentVariables.Add ("GIT_SSH_COMMAND", SSHPath);
|
||||
}
|
||||
|
||||
if (string.IsNullOrEmpty (ExecPath))
|
||||
|
|
|
@ -145,7 +145,8 @@ namespace SparkleLib {
|
|||
|
||||
SparkleUser user = new SparkleUser (user_name, user_email);
|
||||
|
||||
string [] private_key_file_paths = Directory.GetFiles (Path.GetDirectoryName (FullPath), "*.key");
|
||||
string ssh_path = Path.Combine (Path.GetDirectoryName (FullPath), "ssh");
|
||||
string [] private_key_file_paths = Directory.GetFiles(ssh_path, "*.key");
|
||||
|
||||
if (private_key_file_paths.Length > 0) {
|
||||
user.PrivateKey = File.ReadAllText (private_key_file_paths [0]);
|
||||
|
|
|
@ -43,14 +43,14 @@ namespace SparkleLib {
|
|||
return true;
|
||||
|
||||
string host_key = FetchHostKey ();
|
||||
|
||||
|
||||
if (string.IsNullOrEmpty (RemoteUrl.Host) || host_key == null) {
|
||||
SparkleLogger.LogInfo ("Auth", "Could not fetch host key");
|
||||
this.errors.Add ("error: Could not fetch host key");
|
||||
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
bool warn = true;
|
||||
|
||||
if (RequiredFingerprint != null) {
|
||||
|
|
Loading…
Reference in a new issue