@@ -33,7 +33,6 @@ import (
3333 repo_module "code.gitea.io/gitea/modules/repository"
3434 "code.gitea.io/gitea/modules/setting"
3535 "code.gitea.io/gitea/modules/util"
36- gitea_context "code.gitea.io/gitea/services/context"
3736 issue_service "code.gitea.io/gitea/services/issue"
3837 notify_service "code.gitea.io/gitea/services/notify"
3938)
@@ -1065,11 +1064,9 @@ type CommitInfo struct {
10651064// GetPullCommits returns all commits on given pull request and the last review commit sha
10661065// Attention: The last review commit sha must be from the latest review whose commit id is not empty.
10671066// So the type of the latest review cannot be "ReviewTypeRequest".
1068- func GetPullCommits (ctx * gitea_context .Context , issue * issues_model.Issue ) ([]CommitInfo , string , error ) {
1067+ func GetPullCommits (ctx context .Context , baseGitRepo * git. Repository , doer * user_model. User , issue * issues_model.Issue ) ([]CommitInfo , string , error ) {
10691068 pull := issue .PullRequest
10701069
1071- baseGitRepo := ctx .Repo .GitRepo
1072-
10731070 if err := pull .LoadBaseRepo (ctx ); err != nil {
10741071 return nil , "" , err
10751072 }
@@ -1105,11 +1102,11 @@ func GetPullCommits(ctx *gitea_context.Context, issue *issues_model.Issue) ([]Co
11051102 }
11061103
11071104 var lastReviewCommitID string
1108- if ctx . IsSigned {
1105+ if doer != nil {
11091106 // get last review of current user and store information in context (if available)
11101107 lastreview , err := issues_model .FindLatestReviews (ctx , issues_model.FindReviewOptions {
11111108 IssueID : issue .ID ,
1112- ReviewerID : ctx . Doer .ID ,
1109+ ReviewerID : doer .ID ,
11131110 Types : []issues_model.ReviewType {
11141111 issues_model .ReviewTypeApprove ,
11151112 issues_model .ReviewTypeComment ,
0 commit comments