fix reopen logic for agit flow pull request (#26399) (#26613)

Backport #26399

Signed-off-by: a1012112796 <1012112796@qq.com>
Co-authored-by: Giteabot <teabot@gitea.io>
This commit is contained in:
a1012112796 2023-08-21 21:13:34 +08:00 committed by GitHub
parent fe78aabc67
commit f43df2f820
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -2831,6 +2831,7 @@ func NewComment(ctx *context.Context) {
// check whether the ref of PR <refs/pulls/pr_index/head> in base repo is consistent with the head commit of head branch in the head repo // check whether the ref of PR <refs/pulls/pr_index/head> in base repo is consistent with the head commit of head branch in the head repo
// get head commit of PR // get head commit of PR
if pull.Flow == issues_model.PullRequestFlowGithub {
prHeadRef := pull.GetGitRefName() prHeadRef := pull.GetGitRefName()
if err := pull.LoadBaseRepo(ctx); err != nil { if err := pull.LoadBaseRepo(ctx); err != nil {
ctx.ServerError("Unable to load base repo", err) ctx.ServerError("Unable to load base repo", err)
@ -2880,6 +2881,7 @@ func NewComment(ctx *context.Context) {
} }
} }
} }
}
if pr != nil { if pr != nil {
ctx.Flash.Info(ctx.Tr("repo.pulls.open_unmerged_pull_exists", pr.Index)) ctx.Flash.Info(ctx.Tr("repo.pulls.open_unmerged_pull_exists", pr.Index))