Skip to content

Commit

Permalink
Close file in the Upload func (#30262) (#30269)
Browse files Browse the repository at this point in the history
Co-authored-by: guangwu <guoguangwu@magic-shield.com>
  • Loading branch information
GiteaBot and testwill committed Apr 3, 2024
1 parent 47de6e3 commit 4588c7b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions modules/lfs/filesystem_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 4588c7b

Please sign in to comment.