diff options
author | Lunny Xiao <xiaolunwen@gmail.com> | 2023-06-20 21:58:03 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-06-20 21:58:03 +0200 |
commit | 54259dbf37f4a7f7d8865755484cbcad1c9ea8c0 (patch) | |
tree | 792b4c8a50e2d55bfd3593233aef2387854c191d /routers | |
parent | Add git-lfs support to devcontainer (#25385) (diff) | |
download | forgejo-54259dbf37f4a7f7d8865755484cbcad1c9ea8c0.tar.xz forgejo-54259dbf37f4a7f7d8865755484cbcad1c9ea8c0.zip |
Fix blank dir message when uploading files from web editor (#25391)
Fix #7883
Diffstat (limited to 'routers')
-rw-r--r-- | routers/web/repo/editor.go | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/routers/web/repo/editor.go b/routers/web/repo/editor.go index 7433a0a56b..2fea8a9532 100644 --- a/routers/web/repo/editor.go +++ b/routers/web/repo/editor.go @@ -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) |