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:
wxiaoguangandNicolas authored and GitHub committed 2026-04-29 18:32:46 +00:00
1 parent 184ce17167
commit 2b2ec6af85
9 files changed
+115 -116

No files matched your search

+2 -2
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