| 512 | } |
| 513 | |
| 514 | CStatusCacheEntry CGitStatusCache::GetStatusForPathInternal(const CTGitPath& path, bool bRecursive) |
| 515 | { |
| 516 | if (IsPathGood(path)) |
| 517 | { |
| 518 | // Stop the crawler starting on a new folder while we're doing this much more important task... |
| 519 | // Please note, that this may be a second "lock" used concurrently to the one in RemoveCacheForPath(). |
| 520 | CCrawlInhibitor crawlInhibit(&m_folderCrawler); |
| 521 | |
| 522 | CTGitPath dirpath = path.GetContainingDirectory(); |
| 523 | if ((dirpath.IsEmpty()) || (!m_shellCache.IsPathAllowed(dirpath.GetWinPath()))) |
| 524 | dirpath = path.GetDirectory(); |
| 525 | CCachedDirectory * cachedDir = GetDirectoryCacheEntry(dirpath); |
| 526 | if (cachedDir) |
| 527 | { |
| 528 | //CTraceToOutputDebugString::Instance()(_T(__FUNCTION__) L": GetStatusForMember %d\n", bFetch); |
| 529 | return cachedDir->GetStatusForMember(path, bRecursive, false); |
| 530 | } |
| 531 | } |
| 532 | else |
| 533 | { |
| 534 | // path is blocked for some reason: return the cached status if we have one |
| 535 | // we do here only a cache search, absolutely no disk access is allowed! |
| 536 | auto cachedDir = GetDirectoryCacheEntryNoCreate(path.GetDirectory()); |
| 537 | if (cachedDir) |
| 538 | { |
| 539 | if (path.IsDirectory()) |
| 540 | return cachedDir->GetOwnStatus(false); |
| 541 | else |
| 542 | { |
| 543 | // We've found this directory in the cache |
| 544 | return cachedDir->GetCacheStatusForMember(path); |
| 545 | } |
| 546 | } |
| 547 | } |
| 548 | CTraceToOutputDebugString::Instance()(_T(__FUNCTION__) L": ignored no good path %s\n", path.GetWinPath()); |
| 549 | CStatusCacheEntry status; |
| 550 | if (m_shellCache.ShowExcludedAsNormal() && path.IsDirectory() && m_shellCache.HasGITAdminDir(path.GetWinPath(), true)) |
| 551 | { |
| 552 | CTraceToOutputDebugString::Instance()(_T(__FUNCTION__) L": force status %s\n", path.GetWinPath()); |
| 553 | status.ForceStatus(git_wc_status_normal); |
| 554 | } |
| 555 | return status; |
| 556 | } |
| 557 | |
| 558 | void CGitStatusCache::AddFolderForCrawling(const CTGitPath& path) |
| 559 | { |
nothing calls this directly
no test coverage detected