Beispiel #1
0
        private async Task <IReadOnlyCollection <(GitHubCommit Commit, int IssueNumber)> > GetCommitsWithIssueLinks(
            Regex?latestTagRegex)
        {
            var headCommitSha = _localRepository.HeadCommitSha ??
                                throw new InvalidOperationException("Empty repository?");
            var latestTagCommitSha = _localRepository.GetLatestTagCommitSha(latestTagRegex);
            var baseCommitSha      = latestTagCommitSha ?? _localRepository.FirstCommitSha !;

            var commitsSinceLatestTag = await _gitHubApi
                                        .GetCommitsBetweenAsync(
                baseCommitSha, headCommitSha, includeBaseCommit : latestTagCommitSha == null)
                                        .ConfigureAwait(false);

            return(commitsSinceLatestTag
                   .GetCommitsWithIssueLinks()
                   .ToList()
                   .AsReadOnly());
        }