From ac70a9e327c9ffe2c037a7c0a336938d1f1f12fc Mon Sep 17 00:00:00 2001 From: Sven Strickroth Date: Thu, 31 Jan 2013 16:54:13 +0100 Subject: [PATCH] git.exe of msysgit cmd folder does not work, so try to guess bin folder Signed-off-by: Sven Strickroth --- src/Git/Git.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/Git/Git.cpp b/src/Git/Git.cpp index f751e96a5..0acdb5eae 100644 --- a/src/Git/Git.cpp +++ b/src/Git/Git.cpp @@ -95,6 +95,14 @@ static BOOL FindGitPath() pfin[1] = 0; CGit::ms_LastMsysGitDir = buf; CGit::ms_LastMsysGitDir.TrimRight(_T("\\")); + if (CGit::ms_LastMsysGitDir.GetLength() > 4) + { + // often the msysgit\cmd folder is on the %PATH%, but + // that git.exe does not work, so try to guess the bin folder + CString binDir = CGit::ms_LastMsysGitDir.Mid(0, CGit::ms_LastMsysGitDir.GetLength() - 4) + _T("\\bin\\git.exe"); + if (FileExists(binDir)) + CGit::ms_LastMsysGitDir = CGit::ms_LastMsysGitDir.Mid(0, CGit::ms_LastMsysGitDir.GetLength() - 4) + _T("\\bin"); + } return TRUE; } } -- 2.11.4.GIT