From ff90ffeaa66efd2772b7c692a84217e45ba1a6ff Mon Sep 17 00:00:00 2001 From: Sven Strickroth Date: Sat, 15 Jul 2017 21:43:07 +0200 Subject: [PATCH] Update cached directory properties Signed-off-by: Sven Strickroth --- src/Git/TGitPath.cpp | 4 ++-- src/Git/TGitPath.h | 2 +- src/TGitCache/CachedDirectory.cpp | 1 + 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/Git/TGitPath.cpp b/src/Git/TGitPath.cpp index 6cf177252..9b0f9d6cc 100644 --- a/src/Git/TGitPath.cpp +++ b/src/Git/TGitPath.cpp @@ -865,9 +865,9 @@ bool CTGitPath::HasRebaseApply() const return !!PathFileExists(dotGitPath + L"rebase-apply"); } -bool CTGitPath::HasAdminDir(CString *ProjectTopDir) const +bool CTGitPath::HasAdminDir(CString* ProjectTopDir /* = nullptr */, bool force /* = false */) const { - if (m_bHasAdminDirKnown) + if (m_bHasAdminDirKnown && !force) { if (ProjectTopDir) *ProjectTopDir = m_sProjectRoot; diff --git a/src/Git/TGitPath.h b/src/Git/TGitPath.h index 2ec5a2b30..9286fde16 100644 --- a/src/Git/TGitPath.h +++ b/src/Git/TGitPath.h @@ -234,7 +234,7 @@ public: * is done in the same directory. For folders, it checks if the folder itself * contains an admin directory. */ - bool HasAdminDir(CString* projectTopDir = nullptr) const; + bool HasAdminDir(CString* projectTopDir = nullptr, bool force = false) const; bool HasSubmodules() const; bool HasGitSVNDir() const; bool IsBisectActive() const; diff --git a/src/TGitCache/CachedDirectory.cpp b/src/TGitCache/CachedDirectory.cpp index cfe939b09..9a2318bdb 100644 --- a/src/TGitCache/CachedDirectory.cpp +++ b/src/TGitCache/CachedDirectory.cpp @@ -639,6 +639,7 @@ void CCachedDirectory::RefreshStatus(bool bRecursive) { AutoLocker lock(m_critSec); m_directoryPath.UpdateCase(); + m_directoryPath.HasAdminDir(nullptr, true); } // Make sure that our own status is up-to-date -- 2.11.4.GIT