diff --git a/routers/web/repo/editor.go b/routers/web/repo/editor.go index 025d29f64c..e1a48818e5 100644 --- a/routers/web/repo/editor.go +++ b/routers/web/repo/editor.go @@ -300,7 +300,8 @@ func editFilePost(ctx *context.Context, form forms.EditRepoFileForm, isNewFile b } var contentReader io.ReadSeeker - if isNewFile && form.Content.Has() { + // form content only has data if file is representable as text, is not too large and not in lfs + if isNewFile || form.Content.Has() { contentReader = strings.NewReader(strings.ReplaceAll(form.Content.Value(), "\r", "")) }