Function
makeCommitAuthor
(id *gitdiff.PatchIdentity, d time.Time)
Source from the content-addressed store, hash-verified
| 392 | } |
| 393 | |
| 394 | func makeCommitAuthor(id *gitdiff.PatchIdentity, d time.Time) *github.CommitAuthor { |
| 395 | if id == nil && d.IsZero() { |
| 396 | return nil |
| 397 | } |
| 398 | |
| 399 | a := &github.CommitAuthor{} |
| 400 | if id != nil { |
| 401 | if id.Name != "" { |
| 402 | a.Name = github.Ptr(id.Name) |
| 403 | } |
| 404 | if id.Email != "" { |
| 405 | a.Email = github.Ptr(id.Email) |
| 406 | } |
| 407 | } |
| 408 | if !d.IsZero() { |
| 409 | a.Date = &github.Timestamp{Time: d} |
| 410 | } |
| 411 | return a |
| 412 | } |
Tested by
no test coverage detected