From b4ed3f07e44975e971dcbbf1afcdedbf874c0820 Mon Sep 17 00:00:00 2001 From: Yarden Shoham Date: Fri, 24 Feb 2023 02:47:35 +0200 Subject: [PATCH] Fix commit name in Apply Patch page (#23086) (#23099) Backport #23086 Fixes https://github.com/go-gitea/gitea/issues/22621#issuecomment-1439309200 Co-authored-by: yp05327 <576951401@qq.com> --- routers/web/repo/patch.go | 3 +++ templates/repo/editor/commit_form.tmpl | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/routers/web/repo/patch.go b/routers/web/repo/patch.go index 12b26f38e..0ffec0c4e 100644 --- a/routers/web/repo/patch.go +++ b/routers/web/repo/patch.go @@ -25,6 +25,8 @@ const ( func NewDiffPatch(ctx *context.Context) { canCommit := renderCommitRights(ctx) + ctx.Data["PageIsPatch"] = true + ctx.Data["TreePath"] = "" ctx.Data["commit_summary"] = "" @@ -51,6 +53,7 @@ func NewDiffPatchPost(ctx *context.Context) { if form.CommitChoice == frmCommitChoiceNewBranch { branchName = form.NewBranchName } + ctx.Data["PageIsPatch"] = true ctx.Data["TreePath"] = "" ctx.Data["BranchLink"] = ctx.Repo.RepoLink + "/src/" + ctx.Repo.BranchNameSubURL() ctx.Data["FileContent"] = form.Content diff --git a/templates/repo/editor/commit_form.tmpl b/templates/repo/editor/commit_form.tmpl index 7fac7f13b..c6c48c5a8 100644 --- a/templates/repo/editor/commit_form.tmpl +++ b/templates/repo/editor/commit_form.tmpl @@ -9,7 +9,7 @@ {{.locale.Tr "repo.editor.commit_changes"}} {{- end}}
- +