Skip to content

Commit 7670e56

Browse files
author
Your Name
committed
Support title and body query params in PR creation
1 parent 79a0303 commit 7670e56

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

routers/web/repo/compare.go

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -577,6 +577,22 @@ func PrepareCompareDiff(
577577
ctx.Data["AfterCommitID"] = headCommitID
578578
ctx.Data["ExpandNewPrForm"] = ctx.FormBool("expand")
579579

580+
formTitle := ctx.FormString("title")
581+
formBody := ctx.FormString("body")
582+
quickPull := ctx.FormBool("quick_pull")
583+
584+
if formTitle != "" {
585+
ctx.Data["TitleQuery"] = formTitle
586+
}
587+
588+
if formBody != "" {
589+
ctx.Data["BodyQuery"] = formBody
590+
}
591+
592+
if ctx.Data["ExpandNewPrForm"] != true && (quickPull || formTitle != "" || formBody != "") {
593+
ctx.Data["ExpandNewPrForm"] = true
594+
}
595+
580596
if (headCommitID == ci.CompareInfo.MergeBase && !ci.DirectComparison) ||
581597
headCommitID == ci.CompareInfo.BaseCommitID {
582598
ctx.Data["IsNothingToCompare"] = true

0 commit comments

Comments
 (0)