You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
gitea/services/repository
vincent 35d5e4aea4
Fix content size does not match error when uploading lfs file (#29259)
![image](https://github.com/go-gitea/gitea/assets/38434877/cd726b4d-4771-4547-8aee-ae4e4b56b1d1)
When we update an lfs file by API
`api/v1/repos/{owner}/{repo}/contents/{filepath}`, there will show an
error

```json
{
  "message": "Put \"05904d6c7b16bb9b29587100ab1414\": 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.
12 months ago
..
archiver Simplify how git repositories are opened (#28937) 1 year ago
files Fix content size does not match error when uploading lfs file (#29259) 12 months ago
adopt.go Simplify how git repositories are opened (#28937) 1 year ago
adopt_test.go Use more specific test methods (#24265) 2 years ago
avatar.go Improve avatar uploading / resizing / compressing, remove Fomantic card module (#24653) 2 years ago
avatar_test.go Use context parameter in services/repository (#23186) 2 years ago
branch.go Simplify how git repositories are opened (#28937) 1 year ago
cache.go Always enable caches (#28527) 1 year ago
check.go Update tool dependencies (#29030) 1 year ago
collaboration.go Fix `DeleteCollaboration` transaction behaviour (#28886) 1 year ago
collaboration_test.go Next round of `db.DefaultContext` refactor (#27089) 1 year ago
commit.go Show branches and tags that contain a commit (#25180) 2 years ago
contributors_graph.go Implement contributors graph (#27882) 12 months ago
contributors_graph_test.go Implement contributors graph (#27882) 12 months ago
create.go Simplify how git repositories are opened (#28937) 1 year ago
create_test.go bump to use go 1.22 (#29119) 12 months ago
delete.go Use db.Find instead of writing methods for every object (#28084) 1 year ago
delete_test.go Delete repos of org when purge delete user (#27273) 1 year ago
fork.go Simplify how git repositories are opened (#28937) 1 year ago
fork_test.go Add option to prohibit fork if user reached maximum limit of repositories (#21848) 2 years ago
hooks.go Simplify how git repositories are opened (#28937) 1 year ago
lfs.go Simplify how git repositories are opened (#28937) 1 year ago
lfs_test.go Remove GetByBean method because sometimes it's danger when query condition parameter is zero and also introduce new generic methods (#28220) 1 year ago
main_test.go make writing main test easier (#27270) 1 year ago
push.go Do not use lower tag names to find releases/tags (#29261) 12 months ago
repository.go Remove unnecessary parameter (#27671) 1 year ago
repository_test.go refactor some functions to support ctx as first parameter (#21878) 2 years ago
review.go Use context parameter in services/repository (#23186) 2 years ago
review_test.go Use context parameter in services/repository (#23186) 2 years ago
setting.go Fix an actions schedule bug (#28942) 1 year ago
template.go Move notification interface to services layer (#26915) 1 year ago
transfer.go Move some repository transfer functions to service layer (#28855) 1 year ago
transfer_test.go Move some repository transfer functions to service layer (#28855) 1 year ago