From e960fe34c58327fb0d302005578250f14dc29c4d Mon Sep 17 00:00:00 2001 From: bytedream Date: Mon, 5 May 2025 18:55:47 +0200 Subject: [PATCH] Fix file content only read on new file --- routers/web/repo/editor.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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", "")) }