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

Commit cbd5c3f

Browse files
committed
Put lfs before git in the env path so that custom lfs paths are preferred
1 parent 14d13a3 commit cbd5c3f

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

Diff for: src/GitHub.Api/Platform/ProcessEnvironment.cs

+7-4
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ public void Configure(ProcessStartInfo psi, NPath workingDirectory, bool dontSet
3838
string separator = Environment.IsWindows ? ";" : ":";
3939

4040
NPath libexecPath = NPath.Default;
41+
List<string> gitPathEntries = new List<string>();
4142
if (Environment.GitInstallPath.IsInitialized)
4243
{
4344
var gitPathRoot = Environment.GitExecutablePath.Resolve().Parent.Parent;
@@ -60,16 +61,16 @@ public void Configure(ProcessStartInfo psi, NPath workingDirectory, bool dontSet
6061

6162
if (Environment.IsWindows)
6263
{
63-
pathEntries.AddRange(new[] { gitPathRoot.Combine("cmd").ToString(), gitPathRoot.Combine("usr", "bin") });
64+
gitPathEntries.AddRange(new[] { gitPathRoot.Combine("cmd").ToString(), gitPathRoot.Combine("usr", "bin") });
6465
}
6566
else
6667
{
67-
pathEntries.Add(gitExecutableDir.ToString());
68+
gitPathEntries.Add(gitExecutableDir.ToString());
6869
}
6970

7071
if (libexecPath.IsInitialized)
71-
pathEntries.Add(libexecPath);
72-
pathEntries.Add(binPath);
72+
gitPathEntries.Add(libexecPath);
73+
gitPathEntries.Add(binPath);
7374

7475
// we can only set this env var if there is a libexec/git-core. git will bypass internally bundled tools if this env var
7576
// is set, which will break Apple's system git on certain tools (like osx-credentialmanager)
@@ -81,6 +82,8 @@ public void Configure(ProcessStartInfo psi, NPath workingDirectory, bool dontSet
8182
{
8283
pathEntries.Add(Environment.GitLfsInstallPath);
8384
}
85+
if (gitPathEntries.Count > 0)
86+
pathEntries.AddRange(gitPathEntries);
8487

8588
pathEntries.Add("END");
8689

0 commit comments

Comments
 (0)