git: only add GIT_SSH env var if it doesn't exist already

This commit is contained in:
Hylke Bons 2013-03-11 21:01:41 +00:00
parent 1c02a4f7e8
commit 75e8a17d8a

View file

@ -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;