mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2025-10-28 04:51:07 +00:00
 When we update an lfs file by API `api/v1/repos/{owner}/{repo}/contents/{filepath}`, there will show an error ```json { "message": "Put \"http://localhost:9000/gitea/lfs/38/92/05904d6c7bb83fc676513911226f2be25bf1465616bb9b29587100ab1414\": readfrom tcp [::1]:57300->[::1]:9000: content size does not match", "url": "http://localhost:3000/api/swagger" } ``` The reason of this error is https://github.com/go-gitea/gitea/blob/main/services/repository/files/update.go, in this file, the `file.ContentReader` been used twice. So when use `file.ContentReader` in the second time, the `i` of this Reader has been updated to the length of the content. it will return 0 and an `io.EOF` error when we try to read cotent from this Reader. (cherry picked from commit 35d5e4aea4bb02a0b4c7b38ecb2acf612151e891) |
||
|---|---|---|
| .. | ||
| cherry_pick.go | ||
| commit.go | ||
| content.go | ||
| content_test.go | ||
| diff.go | ||
| diff_test.go | ||
| file.go | ||
| file_test.go | ||
| patch.go | ||
| search.go | ||
| search_test.go | ||
| temp_repo.go | ||
| tree.go | ||
| tree_test.go | ||
| update.go | ||
| upload.go | ||