Ejemplo n.º 1
0
        private async Task FindRepo(StreamWriter writer, string path, CancellationToken cancellationToken)
        {
            var cwd = new StringCurrentWorkingDirectory(path);

            var repo = await _repoCache.FindRepoAsync(cwd, cancellationToken);

            if (repo == null)
            {
                _log.Warning("Did not find a repo at '{Path}'", path);

                await writer.WriteLineAsync(string.Empty);
            }
            else
            {
                using (var jsonTextWriter = new JsonTextWriter(writer))
                {
                    _serializer.Serialize(jsonTextWriter, repo);
                }

                _log.Information("Found a repo at '{Path}'", path);
            }
        }
Ejemplo n.º 2
0
        public Task <IRepositoryStatus> FindRepoAsync(ICurrentWorkingDirectory cwd, CancellationToken cancellationToken)
        {
            EnsureServerIsAvailable();

            return(_repositoryCache.FindRepoAsync(cwd, cancellationToken));
        }