Skip to content

Commit

Permalink
Always set PullRequestWorkInProgressPrefixes in PrepareViewPullInfo
Browse files Browse the repository at this point in the history
Move setting PullRequestWorkInProgressPrefixes to the start of PrepareViewPullInfo.

Fix go-gitea#18706

Signed-off-by: Andrew Thornton <art27@cantab.net>
  • Loading branch information
zeripath committed Feb 10, 2022
1 parent 165ab17 commit 058d5eb
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions routers/web/repo/pull.go
Original file line number Diff line number Diff line change
Expand Up @@ -390,6 +390,8 @@ func PrepareMergedViewPullInfo(ctx *context.Context, issue *models.Issue) *git.C

// PrepareViewPullInfo show meta information for a pull request preview page
func PrepareViewPullInfo(ctx *context.Context, issue *models.Issue) *git.CompareInfo {
ctx.Data["PullRequestWorkInProgressPrefixes"] = setting.Repository.PullRequest.WorkInProgressPrefixes

repo := ctx.Repo.Repository
pull := issue.PullRequest

Expand Down Expand Up @@ -579,8 +581,6 @@ func PrepareViewPullInfo(ctx *context.Context, issue *models.Issue) *git.Compare
ctx.Data["IsNothingToCompare"] = true
}

ctx.Data["PullRequestWorkInProgressPrefixes"] = setting.Repository.PullRequest.WorkInProgressPrefixes

if pull.IsWorkInProgress() {
ctx.Data["IsPullWorkInProgress"] = true
ctx.Data["WorkInProgressPrefix"] = pull.GetWorkInProgressPrefix()
Expand Down

0 comments on commit 058d5eb

Please sign in to comment.