Fix file content only read on new file

This commit is contained in:
bytedream
2025-05-05 18:55:47 +02:00
parent 6f3b69b900
commit e960fe34c5
+2 -1
View File
@@ -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", ""))
}