From 7ac6cc65047ed4565ab9731d705d28c01f738b51 Mon Sep 17 00:00:00 2001 From: Sup Yut Sum Date: Sun, 2 Nov 2014 19:05:41 +0800 Subject: [PATCH] Remove %GIT_DIR% before calling git.exe This fixes diff nested submodule failure Signed-off-by: Sup Yut Sum --- src/Git/Git.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/Git/Git.cpp b/src/Git/Git.cpp index 62886e8fe..f3b72b022 100644 --- a/src/Git/Git.cpp +++ b/src/Git/Git.cpp @@ -1964,6 +1964,7 @@ BOOL CGit::CheckMsysGitDir(BOOL bFallback) CTraceToOutputDebugString::Instance()(_T(__FUNCTION__) _T(": CheckMsysGitDir(%d)\n"), bFallback); this->m_Environment.clear(); m_Environment.CopyProcessEnvironment(); + m_Environment.SetEnv(_T("GIT_DIR"), nullptr); // Remove %GIT_DIR% before executing git.exe TCHAR *oldpath; size_t homesize,size; @@ -2470,6 +2471,9 @@ void CEnvironment::SetEnv(const TCHAR *name, const TCHAR* value) it += i; } + if (value == nullptr) // remove the variable + return; + while(*name) { this->insert(it,*name++); -- 2.11.4.GIT