From 9d4b40dc456e53d76d85592d143d3929ebcbc0a4 Mon Sep 17 00:00:00 2001 From: Hylke Bons Date: Mon, 11 Mar 2013 21:01:41 +0000 Subject: [PATCH] git: only add GIT_SSH env var if it doesn't exist already --- SparkleLib/Git/SparkleGit.cs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/SparkleLib/Git/SparkleGit.cs b/SparkleLib/Git/SparkleGit.cs index 7c71cf28..250b2674 100644 --- a/SparkleLib/Git/SparkleGit.cs +++ b/SparkleLib/Git/SparkleGit.cs @@ -118,8 +118,12 @@ namespace SparkleLib.Git { StartInfo.WorkingDirectory = path; StartInfo.CreateNoWindow = true; - if (!string.IsNullOrEmpty (SSHPath)) - StartInfo.EnvironmentVariables.Add ("GIT_SSH", SSHPath); + if (!string.IsNullOrEmpty (SSHPath)) { + if (StartInfo.EnvironmentVariables.ContainsKey ("GIT_SSH")) + StartInfo.EnvironmentVariables ["GIT_SSH"] = SSHPath; + else + StartInfo.EnvironmentVariables.Add ("GIT_SSH", SSHPath); + } if (string.IsNullOrEmpty (ExecPath)) StartInfo.Arguments = args;