We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f003305 commit f34a0b9Copy full SHA for f34a0b9
routers/web/repo/editor.go
@@ -392,6 +392,14 @@ func EditFilePost(ctx *context.Context) {
392
// NewFilePost response for creating file
393
func NewFilePost(ctx *context.Context) {
394
form := web.GetForm(ctx).(*forms.EditRepoFileForm)
395
+
396
+ // trim leading and trailing spaces from the tree path
397
+ treePath := strings.Split(form.TreePath, "/")
398
+ for i, v := range treePath {
399
+ treePath[i] = strings.TrimSpace(v)
400
+ }
401
+ form.TreePath = strings.Join(treePath, "/")
402
403
editFilePost(ctx, *form, true)
404
}
405
0 commit comments