Fix race in LFS ContentStore.Put(...) (#14895)
Fix race in LFS ContentStore.Put(...) (#14895)

Continuing on from #14888

The previous implementation has race whereby an incomplete upload or
hash mismatch upload can end up in the ContentStore. This PR moves the
validation into the reader so that if there is a hash error or size
mismatch the reader will return with an error instead of an io.EOF
causing the storage to abort the storage.

Signed-off-by: Andrew Thornton <6a547fdd28db89120bdd70d4af1f9ba672ccd43a@cantab.net>
go-gitea/gitea,vdbt/gitea,cez81/gitea,cez81/gitea,go-gitea/gitea,vdbt/gitea,go-gitea/gitea,cez81/gitea