@@ -38,6 +38,7 @@ public void Configure(ProcessStartInfo psi, NPath workingDirectory, bool dontSet
38
38
string separator = Environment . IsWindows ? ";" : ":" ;
39
39
40
40
NPath libexecPath = NPath . Default ;
41
+ List < string > gitPathEntries = new List < string > ( ) ;
41
42
if ( Environment . GitInstallPath . IsInitialized )
42
43
{
43
44
var gitPathRoot = Environment . GitExecutablePath . Resolve ( ) . Parent . Parent ;
@@ -60,16 +61,16 @@ public void Configure(ProcessStartInfo psi, NPath workingDirectory, bool dontSet
60
61
61
62
if ( Environment . IsWindows )
62
63
{
63
- pathEntries . AddRange ( new [ ] { gitPathRoot . Combine ( "cmd" ) . ToString ( ) , gitPathRoot . Combine ( "usr" , "bin" ) } ) ;
64
+ gitPathEntries . AddRange ( new [ ] { gitPathRoot . Combine ( "cmd" ) . ToString ( ) , gitPathRoot . Combine ( "usr" , "bin" ) } ) ;
64
65
}
65
66
else
66
67
{
67
- pathEntries . Add ( gitExecutableDir . ToString ( ) ) ;
68
+ gitPathEntries . Add ( gitExecutableDir . ToString ( ) ) ;
68
69
}
69
70
70
71
if ( libexecPath . IsInitialized )
71
- pathEntries . Add ( libexecPath ) ;
72
- pathEntries . Add ( binPath ) ;
72
+ gitPathEntries . Add ( libexecPath ) ;
73
+ gitPathEntries . Add ( binPath ) ;
73
74
74
75
// we can only set this env var if there is a libexec/git-core. git will bypass internally bundled tools if this env var
75
76
// 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
81
82
{
82
83
pathEntries . Add ( Environment . GitLfsInstallPath ) ;
83
84
}
85
+ if ( gitPathEntries . Count > 0 )
86
+ pathEntries . AddRange ( gitPathEntries ) ;
84
87
85
88
pathEntries . Add ( "END" ) ;
86
89
0 commit comments