mirror of
https://github.com/go-gitea/gitea.git
synced 2025-10-24 20:49:47 +02:00
Fix file content only read on new file
This commit is contained in:
parent
6f3b69b900
commit
e960fe34c5
@ -300,7 +300,8 @@ func editFilePost(ctx *context.Context, form forms.EditRepoFileForm, isNewFile b
|
|||||||
}
|
}
|
||||||
|
|
||||||
var contentReader io.ReadSeeker
|
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", ""))
|
contentReader = strings.NewReader(strings.ReplaceAll(form.Content.Value(), "\r", ""))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user