From db8f1b3433b7cf9efa49b9dd7a26503c815b660e Mon Sep 17 00:00:00 2001 From: Sven Strickroth Date: Sun, 5 Jul 2015 03:59:18 +0200 Subject: [PATCH] Make sure all possible bin directories containing sh.exe are on the PATH Git for Windows 2.4.5.1.windows.1 added sh.exe to the bin folder, causing the usr/bin folder which contains all other unix tools not being on the path. Signed-off-by: Sven Strickroth --- src/Git/Git.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Git/Git.cpp b/src/Git/Git.cpp index 0b1639efe..85922068d 100644 --- a/src/Git/Git.cpp +++ b/src/Git/Git.cpp @@ -2160,10 +2160,10 @@ BOOL CGit::CheckMsysGitDir(BOOL bFallback) { CString temp; PathCanonicalize(CStrBuf(temp, MAX_PATH), possibleShExe); - sh.Format(L"\"%s\"", (LPCTSTR)temp); + if (!sh.IsEmpty()) // remember only the first found sh.exe, but make sure all possible bin-directories are on the PATH + sh.Format(L"\"%s\"", (LPCTSTR)temp); // we need to put the usr\bin folder on the path for Git for Windows based on msys2 m_Environment.AddToPath(temp.Left(temp.GetLength() - 7)); // 7 = len("\\sh.exe") - break; } } if (git_filter_register("filter", git_filter_filter_new(sh, m_Environment), GIT_FILTER_DRIVER_PRIORITY)) -- 2.11.4.GIT