From 314ab751efae8fc2a4684620359783e2fa698813 Mon Sep 17 00:00:00 2001 From: Sven Strickroth Date: Fri, 14 Nov 2014 17:32:05 +0100 Subject: [PATCH] Correctly update folder status on file change and propagate to parents Signed-off-by: Sven Strickroth --- src/TGitCache/CachedDirectory.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/TGitCache/CachedDirectory.cpp b/src/TGitCache/CachedDirectory.cpp index 1fe908a26..69e792871 100644 --- a/src/TGitCache/CachedDirectory.cpp +++ b/src/TGitCache/CachedDirectory.cpp @@ -438,6 +438,13 @@ int CCachedDirectory::EnumFiles(const CTGitPath &path , bool IsFull) bool assumeValid = false; bool skipWorktree = false; pStatus->GetFileStatus(sProjectRoot, sSubPath, &status, IsFull, false, true, GetStatusCallback, this, &assumeValid, &skipWorktree); + if (status < m_mostImportantFileStatus) + { + m_mostImportantFileStatus = git_wc_status_none; + m_ownStatus = git_wc_status_none; + RefreshMostImportant(); + UpdateCurrentStatus(); + } } else { @@ -868,6 +875,9 @@ void CCachedDirectory::RefreshMostImportant() newStatus = GitStatus::GetMoreImportant(newStatus, git_wc_status_modified); } } + // if just a file in a folder is deleted or added report back that the folder is modified and not deleted or added + if (newStatus == git_wc_status_deleted || newStatus == git_wc_status_added) + newStatus = git_wc_status_modified; if (newStatus != m_mostImportantFileStatus) { CTraceToOutputDebugString::Instance()(_T(__FUNCTION__) _T(": status change of path %s\n"), m_directoryPath.GetWinPath()); -- 2.11.4.GIT