Refactor compare diff/pull page (1) (#37481)

1. Rename CompareInfo.MergeBase to CompareBase, it is not merge base
2. Remove unused template variables `ctx.Data["Username"]` and
`ctx.Data["Reponame"]`
3. Decouple some template variable accesses, use typed struct

---------

Co-authored-by: Nicolas <bircni@icloud.com>
This commit is contained in:
wxiaoguang
2026-04-30 02:32:46 +08:00
committed by GitHub
parent 184ce17167
commit 2b2ec6af85
9 changed files with 115 additions and 116 deletions

View File

@@ -521,7 +521,7 @@ func CreatePullRequest(ctx *context.APIContext) {
BaseBranch: compareResult.BaseRef.ShortName(),
HeadRepo: compareResult.HeadRepo,
BaseRepo: repo,
MergeBase: compareResult.MergeBase,
MergeBase: compareResult.CompareBase,
Type: issues_model.PullRequestGitea,
}
@@ -1569,7 +1569,7 @@ func GetPullRequestFiles(ctx *context.APIContext) {
return
}
startCommitID := compareInfo.MergeBase
startCommitID := compareInfo.CompareBase
endCommitID := headCommitID
maxLines := setting.Git.MaxGitDiffLines