private static CommitRow CreateCommitRow(TeamFoundationRequestContext requestContext, TeamFoundationGitCommitService commitService, TfsGitCommit gitCommit, CommitRowType rowType, PushNotification pushNotification, Dictionary <byte[], List <string> > refNames) { var commitManifest = commitService.GetCommitManifest(requestContext, gitCommit.Repository, gitCommit.ObjectId); string repoUri = gitCommit.Repository.GetRepositoryUri(requestContext); var commitRow = new CommitRow() { CommitId = gitCommit.ObjectId, Type = rowType, CommitUri = repoUri + "/commit/" + gitCommit.ObjectId.ToHexString(), AuthorTime = gitCommit.GetLocalAuthorTime(requestContext), Author = gitCommit.GetAuthor(requestContext), AuthorName = gitCommit.GetAuthorName(requestContext), AuthorEmail = gitCommit.GetAuthorEmail(requestContext), Comment = gitCommit.GetComment(requestContext), ChangeCounts = commitManifest.ChangeCounts }; List <string> refs = null; refNames.TryGetValue(gitCommit.ObjectId, out refs); commitRow.RefNames = refs; return(commitRow); }
private static CommitRow CreateCommitRow(IVssRequestContext requestContext, ITeamFoundationGitCommitService commitService, ITfsGitRepository repository, TfsGitCommit gitCommit, CommitRowType rowType, PushNotification pushNotification, Dictionary <Sha1Id, List <GitRef> > refLookup) { var commitManifest = commitService.GetCommitManifest(requestContext, repository, gitCommit.ObjectId); string repoUri = repository.GetRepositoryUri(); var commitRow = new CommitRow() { CommitId = gitCommit.ObjectId, Type = rowType, CommitUri = repoUri + "/commit/" + gitCommit.ObjectId.ToHexString(), AuthorTime = gitCommit.GetAuthor().LocalTime, Author = gitCommit.GetAuthor().NameAndEmail, AuthorName = gitCommit.GetAuthor().Name, AuthorEmail = gitCommit.GetAuthor().Email, Comment = gitCommit.GetComment(), ChangeCounts = commitManifest.ChangeCounts }; List <GitRef> refs; refLookup.TryGetValue(gitCommit.ObjectId, out refs); commitRow.Refs = refs; return(commitRow); }