@@ -600,8 +600,8 @@ func CreateRefComment(doer *User, repo *Repository, issue *Issue, content, commi
600
600
return err
601
601
}
602
602
603
- // ClearPullPushComent clear all the push commit on issue since fore push
604
- func ClearPullPushComent (issue * Issue ) error {
603
+ // ClearPullPushComment clear all the push commit on issue since fore push
604
+ func ClearPullPushComment (issue * Issue ) error {
605
605
_ , err := x .Delete (& Comment {
606
606
Type : CommentTypePullPushCommit ,
607
607
IssueID : issue .ID ,
@@ -610,16 +610,16 @@ func ClearPullPushComent(issue *Issue) error {
610
610
}
611
611
612
612
// CreatePullPushComment creates a commit when push commit to a pull request.
613
- func CreatePullPushComment (doer * User , repo * Repository , issue * Issue , content , commitSHA , repoFullName string ) error {
614
- if len (commitSHA ) == 0 {
613
+ func CreatePullPushComment (doer * User , repo * Repository , issue * Issue , commit * PushCommit ) error {
614
+ if len (commit . Sha1 ) == 0 {
615
615
return fmt .Errorf ("cannot create reference with empty commit SHA" )
616
616
}
617
617
618
618
// Check if same reference from same commit has already existed.
619
619
has , err := x .Get (& Comment {
620
620
Type : CommentTypePullPushCommit ,
621
621
IssueID : issue .ID ,
622
- CommitSHA : commitSHA ,
622
+ CommitSHA : commit . Sha1 ,
623
623
})
624
624
if err != nil {
625
625
return fmt .Errorf ("check pull push comment: %v" , err )
@@ -631,9 +631,9 @@ func CreatePullPushComment(doer *User, repo *Repository, issue *Issue, content,
631
631
Doer : doer ,
632
632
Repo : repo ,
633
633
Issue : issue ,
634
- CommitSHA : commitSHA ,
635
- Content : content ,
636
- RepoFullName : repoFullName ,
634
+ CommitSHA : commit . Sha1 ,
635
+ Content : commit . Message ,
636
+ RepoFullName : repo . FullName () ,
637
637
})
638
638
}
639
639
return err
0 commit comments