@@ -33,7 +33,6 @@ import (
33
33
repo_module "code.gitea.io/gitea/modules/repository"
34
34
"code.gitea.io/gitea/modules/setting"
35
35
"code.gitea.io/gitea/modules/util"
36
- gitea_context "code.gitea.io/gitea/services/context"
37
36
issue_service "code.gitea.io/gitea/services/issue"
38
37
notify_service "code.gitea.io/gitea/services/notify"
39
38
)
@@ -1065,11 +1064,9 @@ type CommitInfo struct {
1065
1064
// GetPullCommits returns all commits on given pull request and the last review commit sha
1066
1065
// Attention: The last review commit sha must be from the latest review whose commit id is not empty.
1067
1066
// 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 ) {
1069
1068
pull := issue .PullRequest
1070
1069
1071
- baseGitRepo := ctx .Repo .GitRepo
1072
-
1073
1070
if err := pull .LoadBaseRepo (ctx ); err != nil {
1074
1071
return nil , "" , err
1075
1072
}
@@ -1105,11 +1102,11 @@ func GetPullCommits(ctx *gitea_context.Context, issue *issues_model.Issue) ([]Co
1105
1102
}
1106
1103
1107
1104
var lastReviewCommitID string
1108
- if ctx . IsSigned {
1105
+ if doer != nil {
1109
1106
// get last review of current user and store information in context (if available)
1110
1107
lastreview , err := issues_model .FindLatestReviews (ctx , issues_model.FindReviewOptions {
1111
1108
IssueID : issue .ID ,
1112
- ReviewerID : ctx . Doer .ID ,
1109
+ ReviewerID : doer .ID ,
1113
1110
Types : []issues_model.ReviewType {
1114
1111
issues_model .ReviewTypeApprove ,
1115
1112
issues_model .ReviewTypeComment ,
0 commit comments