Exemplo n.º 1
0
        private void EnsureStatusCache()
        {
            var repositoryStatusCode = Repository.GetStatusCode();

            // compare the status code and not the full status string because the latter one is heavier to calculate
            bool canTakeFromCache = _cachedRepositoryStatusCode == repositoryStatusCode;

            if (!canTakeFromCache)
            {
                var compressor = new StatusCompressor(new StatusCharacterMap());
                _cachedRepositoryStatus           = compressor.Compress(Repository);
                _cachedRepositoryStatusWithBranch = compressor.CompressWithBranch(Repository);

                _cachedRepositoryStatusCode = repositoryStatusCode;
            }
        }
Exemplo n.º 2
0
 public DefaultRepositoryInformationAggregator(StatusCompressor compressor, IThreadDispatcher dispatcher)
 {
     _dispatcher = dispatcher;
 }