mirror of
https://github.com/go-gitea/gitea
synced 2025-07-25 19:58:36 +00:00
Fix #29763 Backport #29783 This PR fixes 2 problems with CodeOwner in the pull request. - Don't use the pull request base branch but merge-base as a diff base to detect the code owner. - CodeOwner detection in fork repositories will be disabled because almost all the fork repositories will not change CODEOWNERS files but it should not be used on fork repositories' pull requests. --------- Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
This commit is contained in:
@@ -91,7 +91,7 @@ func CheckPullMergable(stdCtx context.Context, doer *user_model.User, perm *acce
|
||||
return nil
|
||||
}
|
||||
|
||||
if pr.IsWorkInProgress() {
|
||||
if pr.IsWorkInProgress(ctx) {
|
||||
return ErrIsWorkInProgress
|
||||
}
|
||||
|
||||
|
@@ -126,8 +126,8 @@ func NewPullRequest(ctx context.Context, repo *repo_model.Repository, issue *iss
|
||||
return err
|
||||
}
|
||||
|
||||
if !pr.IsWorkInProgress() {
|
||||
if err := issues_model.PullRequestCodeOwnersReview(ctx, issue, pr); err != nil {
|
||||
if !pr.IsWorkInProgress(ctx) {
|
||||
if err := issue_service.PullRequestCodeOwnersReview(ctx, issue, pr); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user