mirror of
https://github.com/go-gitea/gitea.git
synced 2025-07-18 02:12:53 +02:00
Backport #34537 by endo0911engineer Co-authored-by: endo0911engineer <161911062+endo0911engineer@users.noreply.github.com> Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
This commit is contained in:
parent
23d2d224c2
commit
6f5f0be9e3
@ -574,7 +574,13 @@ func PrepareCompareDiff(
|
|||||||
|
|
||||||
ctx.Data["CommitRepoLink"] = ci.HeadRepo.Link()
|
ctx.Data["CommitRepoLink"] = ci.HeadRepo.Link()
|
||||||
ctx.Data["AfterCommitID"] = headCommitID
|
ctx.Data["AfterCommitID"] = headCommitID
|
||||||
ctx.Data["ExpandNewPrForm"] = ctx.FormBool("expand")
|
|
||||||
|
// follow GitHub's behavior: autofill the form and expand
|
||||||
|
newPrFormTitle := ctx.FormTrim("title")
|
||||||
|
newPrFormBody := ctx.FormTrim("body")
|
||||||
|
ctx.Data["ExpandNewPrForm"] = ctx.FormBool("expand") || ctx.FormBool("quick_pull") || newPrFormTitle != "" || newPrFormBody != ""
|
||||||
|
ctx.Data["TitleQuery"] = newPrFormTitle
|
||||||
|
ctx.Data["BodyQuery"] = newPrFormBody
|
||||||
|
|
||||||
if (headCommitID == ci.CompareInfo.MergeBase && !ci.DirectComparison) ||
|
if (headCommitID == ci.CompareInfo.MergeBase && !ci.DirectComparison) ||
|
||||||
headCommitID == ci.CompareInfo.BaseCommitID {
|
headCommitID == ci.CompareInfo.BaseCommitID {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user