Skip to content

Commit

Permalink
Always set PullRequestWorkInProgressPrefixes in PrepareViewPullInfo (g…
Browse files Browse the repository at this point in the history
…o-gitea#18713)

Move setting PullRequestWorkInProgressPrefixes to the start of PrepareViewPullInfo.

Fix go-gitea#18706

Signed-off-by: Andrew Thornton <art27@cantab.net>
  • Loading branch information
zeripath authored Feb 11, 2022
1 parent b2b3225 commit 393ea86
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 393ea86

Please sign in to comment.