0
0
mirror of https://github.com/go-gitea/gitea.git synced 2025-09-12 08:26:27 +02:00

Fix a compare page 404 bug when the pull request disabled (#35441)

This commit is contained in:
Lunny Xiao 2025-09-09 21:04:32 -07:00 committed by GitHub
parent e35e724e42
commit 274f4aea7e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -524,7 +524,7 @@ func ParseCompareInfo(ctx *context.Context) *common.CompareInfo {
// Treat as pull request if both references are branches
if ctx.Data["PageIsComparePull"] == nil {
ctx.Data["PageIsComparePull"] = headIsBranch && baseIsBranch
ctx.Data["PageIsComparePull"] = headIsBranch && baseIsBranch && permBase.CanReadIssuesOrPulls(true)
}
if ctx.Data["PageIsComparePull"] == true && !permBase.CanReadIssuesOrPulls(true) {
@ -730,6 +730,7 @@ func CompareDiff(ctx *context.Context) {
return
}
ctx.Data["PageIsViewCode"] = true
ctx.Data["PullRequestWorkInProgressPrefixes"] = setting.Repository.PullRequest.WorkInProgressPrefixes
ctx.Data["DirectComparison"] = ci.DirectComparison
ctx.Data["OtherCompareSeparator"] = ".."