From 230014c1f858ff45fd27247c953ca9eb40508df4 Mon Sep 17 00:00:00 2001 From: Sven Strickroth Date: Sat, 15 Jul 2017 21:18:25 +0200 Subject: [PATCH] Directly react on and correctly handle case changes Signed-off-by: Sven Strickroth --- src/Git/TGitPath.cpp | 8 ++++++++ src/Git/TGitPath.h | 2 ++ src/TGitCache/CachedDirectory.cpp | 5 +++++ 3 files changed, 15 insertions(+) diff --git a/src/Git/TGitPath.cpp b/src/Git/TGitPath.cpp index 4640f0855..6cf177252 100644 --- a/src/Git/TGitPath.cpp +++ b/src/Git/TGitPath.cpp @@ -205,6 +205,14 @@ void CTGitPath::SetFromUnknown(const CString& sPath) SetFwdslashPath(sPath); } +void CTGitPath::UpdateCase() +{ + m_sBackslashPath = CPathUtils::GetLongPathname(GetWinPathString()); + CPathUtils::TrimTrailingPathDelimiter(m_sBackslashPath); + SanitizeRootPath(m_sBackslashPath, false); + SetFwdslashPath(m_sBackslashPath); +} + LPCTSTR CTGitPath::GetWinPath() const { if(IsEmpty()) diff --git a/src/Git/TGitPath.h b/src/Git/TGitPath.h index 9536b00fb..2ec5a2b30 100644 --- a/src/Git/TGitPath.h +++ b/src/Git/TGitPath.h @@ -151,6 +151,8 @@ public: */ CString GetFileExtension() const; + void UpdateCase(); + bool IsEmpty() const; void Reset(); /** diff --git a/src/TGitCache/CachedDirectory.cpp b/src/TGitCache/CachedDirectory.cpp index 162dbbd1d..cfe939b09 100644 --- a/src/TGitCache/CachedDirectory.cpp +++ b/src/TGitCache/CachedDirectory.cpp @@ -636,6 +636,11 @@ CStatusCacheEntry CCachedDirectory::GetOwnStatus(bool bRecursive) void CCachedDirectory::RefreshStatus(bool bRecursive) { + { + AutoLocker lock(m_critSec); + m_directoryPath.UpdateCase(); + } + // Make sure that our own status is up-to-date GetStatusForMember(m_directoryPath,bRecursive); -- 2.11.4.GIT