1
1
mirror of https://github.com/go-gitea/gitea synced 2025-07-12 13:37:20 +00:00

Add size to Save function (#15264) (#15271)

Backport #15264

This PR proposes an alternative solution to #15255 - just add the size to the
save function. Yes it is less apparently clean but it may be more correct.

Close #15255
Fix #15253

Signed-off-by: Andrew Thornton <art27@cantab.net>
This commit is contained in:
zeripath
2021-04-04 17:04:36 +01:00
committed by GitHub
parent 558b0005ff
commit 013639b13f
7 changed files with 18 additions and 10 deletions

View File

@ -65,7 +65,7 @@ func (l *LocalStorage) Open(path string) (Object, error) {
}
// Save a file
func (l *LocalStorage) Save(path string, r io.Reader) (int64, error) {
func (l *LocalStorage) Save(path string, r io.Reader, size int64) (int64, error) {
p := filepath.Join(l.dir, path)
if err := os.MkdirAll(filepath.Dir(p), os.ModePerm); err != nil {
return 0, err