1
1
Fork 1
mirror of https://github.com/go-gitea/gitea.git synced 2024-06-01 10:46:07 +02:00

Fix blank dir message when uploading files from web editor (#25391)

Fix #7883
This commit is contained in:
Lunny Xiao 2023-06-21 03:58:03 +08:00 committed by GitHub
parent a95a7bcdf3
commit 54259dbf37
Signed by: GitHub
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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)