| 379 | } |
| 380 | |
| 381 | bool CGitStatusCache::RemoveCacheForDirectory(CCachedDirectory* cdir, const CTGitPath& origPath) |
| 382 | { |
| 383 | if (!cdir) |
| 384 | return false; |
| 385 | |
| 386 | CAutoWriteLock writeLock(m_guard); |
| 387 | if (!cdir->m_childDirectories.empty()) |
| 388 | { |
| 389 | for (auto it = cdir->m_childDirectories.begin(); it != cdir->m_childDirectories.end();) |
| 390 | { |
| 391 | CCachedDirectory * childdir = CGitStatusCache::Instance().GetDirectoryCacheEntryNoCreate(it->first); |
| 392 | if ((childdir) && (!cdir->m_directoryPath.IsEquivalentTo(childdir->m_directoryPath)) && (cdir->m_directoryPath.GetFileOrDirectoryName() != L"..")) |
| 393 | RemoveCacheForDirectory(childdir, it->first); |
| 394 | cdir->m_childDirectories.erase(it->first); |
| 395 | it = cdir->m_childDirectories.begin(); |
| 396 | } |
| 397 | } |
| 398 | cdir->m_childDirectories.clear(); |
| 399 | |
| 400 | RemoveCacheForDirectoryChildren(cdir, origPath); |
| 401 | RemoveCacheForDirectoryChildren(cdir, cdir->m_directoryPath); |
| 402 | |
| 403 | CTraceToOutputDebugString::Instance()(_T(__FUNCTION__) L": removed from cache %s\n", cdir->m_directoryPath.GetWinPath()); |
| 404 | delete cdir; |
| 405 | return true; |
| 406 | } |
| 407 | |
| 408 | void CGitStatusCache::RemoveCacheForPath(const CTGitPath& path) |
| 409 | { |
nothing calls this directly
no test coverage detected