git.exe of msysgit cmd folder does not work, so try to guess bin folder
authorSven Strickroth <email@cs-ware.de>
Thu, 31 Jan 2013 15:54:13 +0000 (31 16:54 +0100)
committerSven Strickroth <email@cs-ware.de>
Thu, 31 Jan 2013 15:54:13 +0000 (31 16:54 +0100)
Signed-off-by: Sven Strickroth <email@cs-ware.de>
src/Git/Git.cpp

index f751e96..0acdb5e 100644 (file)
@@ -95,6 +95,14 @@ static BOOL FindGitPath()
                        pfin[1] = 0;\r
                        CGit::ms_LastMsysGitDir = buf;\r
                        CGit::ms_LastMsysGitDir.TrimRight(_T("\\"));\r
+                       if (CGit::ms_LastMsysGitDir.GetLength() > 4)\r
+                       {\r
+                               // often the msysgit\cmd folder is on the %PATH%, but\r
+                               // that git.exe does not work, so try to guess the bin folder\r
+                               CString binDir = CGit::ms_LastMsysGitDir.Mid(0, CGit::ms_LastMsysGitDir.GetLength() - 4) + _T("\\bin\\git.exe");\r
+                               if (FileExists(binDir))\r
+                                       CGit::ms_LastMsysGitDir = CGit::ms_LastMsysGitDir.Mid(0, CGit::ms_LastMsysGitDir.GetLength() - 4) + _T("\\bin");\r
+                       }\r
                        return TRUE;\r
                }\r
        }\r