Пример #1
0
        public CommitInfo(
            GitCommitApiResponse commit,
            TeamMemberApiResponse teamMember,
            GitRepositoryApiResponse repository)
        {
            if (commit == null)
            {
                throw new ArgumentNullException(nameof(commit));
            }
            if (teamMember == null)
            {
                throw new ArgumentNullException(nameof(teamMember));
            }
            if (repository == null)
            {
                throw new ArgumentNullException(nameof(repository));
            }

            Commit     = new Commit(commit);
            Author     = new Author(teamMember);
            Repository = new Repo(repository);
        }
Пример #2
0
        public Commit(GitCommitApiResponse gitCommit)
        {
            if (gitCommit == null)
            {
                throw new ArgumentNullException(nameof(gitCommit));
            }

            Comment  = gitCommit.Comment;
            CommitId = gitCommit.CommitId;

            AuthorDate  = gitCommit.Author?.Date;
            AuthorEmail = gitCommit.Author?.Email;
            AuthorName  = gitCommit.Author?.Name;

            CommitterDate  = gitCommit.Committer?.Date;
            CommitterEmail = gitCommit.Committer?.Email;
            CommitterName  = gitCommit.Committer?.Name;

            AddChangeCount    = gitCommit.ChangeCounts?.Add ?? 0;
            DeleteChangeCount = gitCommit.ChangeCounts?.Delete ?? 0;
            EditChangeCount   = gitCommit.ChangeCounts?.Edit ?? 0;
        }