@@ -15,14 +15,14 @@ public ProcessEnvironment(IEnvironment environment)
1515 Environment = environment ;
1616 }
1717
18- public void Configure ( ProcessStartInfo psi , NPath workingDirectory )
18+ public void Configure ( ProcessStartInfo psi , NPath workingDirectory , bool dontSetupGit = false )
1919 {
2020 psi . WorkingDirectory = workingDirectory ;
2121 psi . EnvironmentVariables [ "HOME" ] = NPath . HomeDirectory ;
2222 psi . EnvironmentVariables [ "TMP" ] = psi . EnvironmentVariables [ "TEMP" ] = NPath . SystemTemp ;
2323
2424 // if we don't know where git is, then there's nothing else to configure
25- if ( ! Environment . GitInstallPath . IsInitialized )
25+ if ( ! Environment . GitInstallPath . IsInitialized || dontSetupGit )
2626 return ;
2727
2828
@@ -52,7 +52,10 @@ public void Configure(ProcessStartInfo psi, NPath workingDirectory)
5252 baseExecPath = baseExecPath . Combine ( "mingw64" ) ;
5353 binPath = baseExecPath . Combine ( "bin" ) ;
5454 }
55+
5556 var execPath = baseExecPath . Combine ( "libexec" , "git-core" ) ;
57+ if ( ! execPath . DirectoryExists ( ) )
58+ execPath = NPath . Default ;
5659
5760 if ( Environment . IsWindows )
5861 {
@@ -63,7 +66,9 @@ public void Configure(ProcessStartInfo psi, NPath workingDirectory)
6366 {
6467 path = $ "{ gitExecutableDir } :{ binPath } :{ execPath } :{ gitLfsPath } :{ Environment . Path } :{ developerPaths } ";
6568 }
66- psi . EnvironmentVariables [ "GIT_EXEC_PATH" ] = execPath . ToString ( ) ;
69+
70+ if ( execPath . IsInitialized )
71+ psi . EnvironmentVariables [ "GIT_EXEC_PATH" ] = execPath . ToString ( ) ;
6772
6873 psi . EnvironmentVariables [ "PATH" ] = path ;
6974 psi . EnvironmentVariables [ "GHU_FULLPATH" ] = path ;
0 commit comments