mirror of
				https://github.com/go-gitea/gitea
				synced 2025-11-04 05:18:25 +00:00 
			
		
		
		
	Fix commit name in Apply Patch page (#23086)
Fixes https://github.com/go-gitea/gitea/issues/22621#issuecomment-1439309200
This commit is contained in:
		@@ -25,6 +25,8 @@ const (
 | 
				
			|||||||
func NewDiffPatch(ctx *context.Context) {
 | 
					func NewDiffPatch(ctx *context.Context) {
 | 
				
			||||||
	canCommit := renderCommitRights(ctx)
 | 
						canCommit := renderCommitRights(ctx)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						ctx.Data["PageIsPatch"] = true
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	ctx.Data["TreePath"] = ""
 | 
						ctx.Data["TreePath"] = ""
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	ctx.Data["commit_summary"] = ""
 | 
						ctx.Data["commit_summary"] = ""
 | 
				
			||||||
@@ -51,6 +53,7 @@ func NewDiffPatchPost(ctx *context.Context) {
 | 
				
			|||||||
	if form.CommitChoice == frmCommitChoiceNewBranch {
 | 
						if form.CommitChoice == frmCommitChoiceNewBranch {
 | 
				
			||||||
		branchName = form.NewBranchName
 | 
							branchName = form.NewBranchName
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
						ctx.Data["PageIsPatch"] = true
 | 
				
			||||||
	ctx.Data["TreePath"] = ""
 | 
						ctx.Data["TreePath"] = ""
 | 
				
			||||||
	ctx.Data["BranchLink"] = ctx.Repo.RepoLink + "/src/" + ctx.Repo.BranchNameSubURL()
 | 
						ctx.Data["BranchLink"] = ctx.Repo.RepoLink + "/src/" + ctx.Repo.BranchNameSubURL()
 | 
				
			||||||
	ctx.Data["FileContent"] = form.Content
 | 
						ctx.Data["FileContent"] = form.Content
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -9,7 +9,7 @@
 | 
				
			|||||||
			{{.locale.Tr "repo.editor.commit_changes"}}
 | 
								{{.locale.Tr "repo.editor.commit_changes"}}
 | 
				
			||||||
		{{- end}}</h3>
 | 
							{{- end}}</h3>
 | 
				
			||||||
		<div class="field">
 | 
							<div class="field">
 | 
				
			||||||
			<input name="commit_summary" placeholder="{{if .PageIsDelete}}{{.locale.Tr "repo.editor.delete" .TreePath}}{{else if .PageIsUpload}}{{.locale.Tr "repo.editor.upload_files_to_dir" .TreePath}}{{else if .IsNewFile}}{{.locale.Tr "repo.editor.add_tmpl"}}{{else}}{{.locale.Tr "repo.editor.update" .TreePath}}{{end}}" value="{{.commit_summary}}" autofocus>
 | 
								<input name="commit_summary" placeholder="{{if .PageIsDelete}}{{.locale.Tr "repo.editor.delete" .TreePath}}{{else if .PageIsUpload}}{{.locale.Tr "repo.editor.upload_files_to_dir" .TreePath}}{{else if .IsNewFile}}{{.locale.Tr "repo.editor.add_tmpl"}}{{else if .PageIsPatch}}{{.locale.Tr "repo.editor.patch"}}{{else}}{{.locale.Tr "repo.editor.update" .TreePath}}{{end}}" value="{{.commit_summary}}" autofocus>
 | 
				
			||||||
		</div>
 | 
							</div>
 | 
				
			||||||
		<div class="field">
 | 
							<div class="field">
 | 
				
			||||||
			<textarea name="commit_message" placeholder="{{.locale.Tr "repo.editor.commit_message_desc"}}" rows="5">{{.commit_message}}</textarea>
 | 
								<textarea name="commit_message" placeholder="{{.locale.Tr "repo.editor.commit_message_desc"}}" rows="5">{{.commit_message}}</textarea>
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user