1
0
Fork 0
forked from forgejo/forgejo

Fix bug when pushing to a pull request which enabled dismiss approval automatically (#25882) (#26158)

Fix #25858
Backport #25882

The option `dissmiss stale approvals` was listed on protected branch but
never implemented. This PR fixes that.

<img width="1006" alt="图片"

src="60bfa968-4db7-4c24-b8be-2e5978f91bb9">

<img width="1021" alt="图片"

src="8dabc14d-2dfe-40c2-94ed-24fcbf6e0e8f">

(cherry picked from commit 666038a06d)
This commit is contained in:
Lunny Xiao 2023-07-27 10:36:54 +08:00 committed by Earl Warren
parent 7bb8526736
commit 4640c53386
No known key found for this signature in database
GPG key ID: 0579CB2928A78A00
7 changed files with 252 additions and 163 deletions

View file

@ -314,15 +314,13 @@ func (pr *PullRequest) LoadRequestedReviewers(ctx context.Context) error {
return err
}
if len(reviews) > 0 {
err = LoadReviewers(ctx, reviews)
if err != nil {
return err
}
for _, review := range reviews {
pr.RequestedReviewers = append(pr.RequestedReviewers, review.Reviewer)
}
if err = reviews.LoadReviewers(ctx); err != nil {
return err
}
for _, review := range reviews {
pr.RequestedReviewers = append(pr.RequestedReviewers, review.Reviewer)
}
return nil
}