CommitToPushCommit transforms a git.Commit to PushCommit type.
(commit *git.Commit)
| 11 | |
| 12 | // CommitToPushCommit transforms a git.Commit to PushCommit type. |
| 13 | func CommitToPushCommit(commit *git.Commit) *PushCommit { |
| 14 | return &PushCommit{ |
| 15 | Sha1: commit.ID.String(), |
| 16 | Message: commit.Message, |
| 17 | AuthorEmail: commit.Author.Email, |
| 18 | AuthorName: commit.Author.Name, |
| 19 | CommitterEmail: commit.Committer.Email, |
| 20 | CommitterName: commit.Committer.Name, |
| 21 | Timestamp: commit.Committer.When, |
| 22 | } |
| 23 | } |
| 24 | |
| 25 | func CommitsToPushCommits(commits []*git.Commit) *PushCommits { |
| 26 | if len(commits) == 0 { |
no test coverage detected