Browse Source

Close file in the Upload func (#30262) (#30269)

Co-authored-by: guangwu <guoguangwu@magic-shield.com>
tags/v1.21.11
Giteabot 1 month ago
parent
commit
4588c7b705
No account linked to committer's email address
1 changed files with 2 additions and 2 deletions
  1. 2
    2
      modules/lfs/filesystem_client.go

+ 2
- 2
modules/lfs/filesystem_client.go View File

@@ -44,7 +44,7 @@ func (c *FilesystemClient) Download(ctx context.Context, objects []Pointer, call
if err != nil {
return err
}
defer f.Close()
if err := callback(p, f, nil); err != nil {
return err
}
@@ -75,7 +75,7 @@ func (c *FilesystemClient) Upload(ctx context.Context, objects []Pointer, callba
if err != nil {
return err
}
defer f.Close()
_, err = io.Copy(f, content)

return err

Loading…
Cancel
Save