|
|
@ -238,6 +238,8 @@ type PushCommit struct { |
|
|
|
Message string |
|
|
|
Message string |
|
|
|
AuthorEmail string |
|
|
|
AuthorEmail string |
|
|
|
AuthorName string |
|
|
|
AuthorName string |
|
|
|
|
|
|
|
CommitterEmail string |
|
|
|
|
|
|
|
CommitterName string |
|
|
|
Timestamp time.Time |
|
|
|
Timestamp time.Time |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -263,6 +265,12 @@ func (pc *PushCommits) ToApiPayloadCommits(repoLink string) []*api.PayloadCommit |
|
|
|
if err == nil { |
|
|
|
if err == nil { |
|
|
|
authorUsername = author.Name |
|
|
|
authorUsername = author.Name |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
committerUsername := "" |
|
|
|
|
|
|
|
committer, err := GetUserByEmail(commit.CommitterEmail) |
|
|
|
|
|
|
|
if err == nil { |
|
|
|
|
|
|
|
// TODO: check errors other than email not found.
|
|
|
|
|
|
|
|
committerUsername = committer.Name |
|
|
|
|
|
|
|
} |
|
|
|
commits[i] = &api.PayloadCommit{ |
|
|
|
commits[i] = &api.PayloadCommit{ |
|
|
|
ID: commit.Sha1, |
|
|
|
ID: commit.Sha1, |
|
|
|
Message: commit.Message, |
|
|
|
Message: commit.Message, |
|
|
@ -272,6 +280,11 @@ func (pc *PushCommits) ToApiPayloadCommits(repoLink string) []*api.PayloadCommit |
|
|
|
Email: commit.AuthorEmail, |
|
|
|
Email: commit.AuthorEmail, |
|
|
|
UserName: authorUsername, |
|
|
|
UserName: authorUsername, |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
Committer: &api.PayloadCommitter{ |
|
|
|
|
|
|
|
Name: commit.CommitterName, |
|
|
|
|
|
|
|
Email: commit.CommitterEmail, |
|
|
|
|
|
|
|
UserName: committerUsername, |
|
|
|
|
|
|
|
}, |
|
|
|
Timestamp: commit.Timestamp, |
|
|
|
Timestamp: commit.Timestamp, |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|