Skip to content

Commit

Permalink
Fix blank dir message when uploading files from web editor (go-gitea#…
Browse files Browse the repository at this point in the history
  • Loading branch information
lunny authored and GiteaBot committed Jun 20, 2023
1 parent 28ed763 commit 35aef26
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion routers/web/repo/editor.go
Original file line number Diff line number Diff line change
Expand Up @@ -685,7 +685,11 @@ func UploadFilePost(ctx *context.Context) {

message := strings.TrimSpace(form.CommitSummary)
if len(message) == 0 {
message = ctx.Tr("repo.editor.upload_files_to_dir", form.TreePath)
dir := form.TreePath
if dir == "" {
dir = "/"
}
message = ctx.Tr("repo.editor.upload_files_to_dir", dir)
}

form.CommitMessage = strings.TrimSpace(form.CommitMessage)
Expand Down

0 comments on commit 35aef26

Please sign in to comment.