Skip to content
This repository was archived by the owner on Dec 5, 2024. It is now read-only.

Commit a681d18

Browse files
committed
Add some comments and set some windows-only env vars only on windows
1 parent d77f043 commit a681d18

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

src/GitHub.Api/Platform/ProcessEnvironment.cs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,10 +65,13 @@ public void Configure(ProcessStartInfo psi, NPath workingDirectory, bool dontSet
6565
{
6666
pathEntries.Add(gitExecutableDir.ToString());
6767
}
68+
6869
if (execPath.IsInitialized)
6970
pathEntries.Add(execPath);
7071
pathEntries.Add(binPath);
7172

73+
// we can only set this env var if there is a libexec/git-core. git will bypass internally bundled tools if this env var
74+
// is set, which will break Apple's system git on certain tools (like osx-credentialmanager)
7275
if (execPath.IsInitialized)
7376
psi.EnvironmentVariables["GIT_EXEC_PATH"] = execPath.ToString();
7477
}
@@ -88,8 +91,11 @@ public void Configure(ProcessStartInfo psi, NPath workingDirectory, bool dontSet
8891
//TODO: Remove with Git LFS Locking becomes standard
8992
psi.EnvironmentVariables["GITLFSLOCKSENABLED"] = "1";
9093

91-
psi.EnvironmentVariables["PLINK_PROTOCOL"] = "ssh";
92-
psi.EnvironmentVariables["TERM"] = "msys";
94+
if (Environment.IsWindows)
95+
{
96+
psi.EnvironmentVariables["PLINK_PROTOCOL"] = "ssh";
97+
psi.EnvironmentVariables["TERM"] = "msys";
98+
}
9399

94100
var httpProxy = Environment.GetEnvironmentVariable("HTTP_PROXY");
95101
if (!String.IsNullOrEmpty(httpProxy))

0 commit comments

Comments
 (0)