File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -574,7 +574,13 @@ func PrepareCompareDiff(
574574
575575 ctx .Data ["CommitRepoLink" ] = ci .HeadRepo .Link ()
576576 ctx .Data ["AfterCommitID" ] = headCommitID
577- ctx .Data ["ExpandNewPrForm" ] = ctx .FormBool ("expand" )
577+
578+ // follow GitHub's behavior: autofill the form and expand
579+ newPrFormTitle := ctx .FormTrim ("title" )
580+ newPrFormBody := ctx .FormTrim ("body" )
581+ ctx .Data ["ExpandNewPrForm" ] = ctx .FormBool ("expand" ) || ctx .FormBool ("quick_pull" ) || newPrFormTitle != "" || newPrFormBody != ""
582+ ctx .Data ["TitleQuery" ] = newPrFormTitle
583+ ctx .Data ["BodyQuery" ] = newPrFormBody
578584
579585 if (headCommitID == ci .CompareInfo .MergeBase && ! ci .DirectComparison ) ||
580586 headCommitID == ci .CompareInfo .BaseCommitID {
You can’t perform that action at this time.
0 commit comments