From e472631617da1f06d22f72e3cf0bfeae448e6671 Mon Sep 17 00:00:00 2001 From: Sven Strickroth Date: Wed, 29 Jun 2016 16:36:32 +0200 Subject: [PATCH] Properly handle submodules Signed-off-by: Sven Strickroth --- src/Git/GitDataObject.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/Git/GitDataObject.cpp b/src/Git/GitDataObject.cpp index 50f5d2d4b..5faa09e0f 100644 --- a/src/Git/GitDataObject.cpp +++ b/src/Git/GitDataObject.cpp @@ -42,7 +42,7 @@ GitDataObject::GitDataObject(const CTGitPathList& gitpaths, const CGitHash& rev) m_containsExistingFiles = false; for (int i = 0; i < m_gitPaths.GetCount(); ++i) { - if (m_gitPaths[i].m_Action & ~(CTGitPath::LOGACTIONS_MISSING | CTGitPath::LOGACTIONS_DELETED)) + if (m_gitPaths[i].m_Action & ~(CTGitPath::LOGACTIONS_MISSING | CTGitPath::LOGACTIONS_DELETED) && !m_gitPaths[i].IsDirectory()) { m_containsExistingFiles = true; break; @@ -160,7 +160,7 @@ STDMETHODIMP GitDataObject::GetData(FORMATETC* pformatetcIn, STGMEDIUM* pmedium) { for (int i = 0; i < m_gitPaths.GetCount(); ++i) { - if (m_gitPaths[i].m_Action & (CTGitPath::LOGACTIONS_MISSING | CTGitPath::LOGACTIONS_DELETED)) + if (m_gitPaths[i].m_Action & (CTGitPath::LOGACTIONS_MISSING | CTGitPath::LOGACTIONS_DELETED) || m_gitPaths[i].IsDirectory()) continue; m_allPaths.push_back(m_gitPaths[i]); } @@ -276,6 +276,9 @@ STDMETHODIMP GitDataObject::GetData(FORMATETC* pformatetcIn, STGMEDIUM* pmedium) for (int i = 0; i < m_gitPaths.GetCount(); ++i) { + if (m_gitPaths[i].m_Action & (CTGitPath::LOGACTIONS_MISSING | CTGitPath::LOGACTIONS_DELETED) || m_gitPaths[i].IsDirectory()) + continue; + nLength += g_Git.CombinePath(m_gitPaths[i]).GetLength(); nLength += 1; // '\0' separator } @@ -294,6 +297,8 @@ STDMETHODIMP GitDataObject::GetData(FORMATETC* pformatetcIn, STGMEDIUM* pmedium) for (int i = 0; i < m_gitPaths.GetCount(); ++i) { + if (m_gitPaths[i].m_Action & (CTGitPath::LOGACTIONS_MISSING | CTGitPath::LOGACTIONS_DELETED) || m_gitPaths[i].IsDirectory()) + continue; CString str = g_Git.CombinePath(m_gitPaths[i]); wcscpy_s(pCurrentFilename, str.GetLength() + 1, (LPCWSTR)str); pCurrentFilename += str.GetLength(); -- 2.11.4.GIT