fix: close file in the Upload func (#30262)

pull/30253/head^2
guangwu 8 months ago committed by GitHub
parent 1195be41a1
commit 0ceecfc11a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 4
      modules/lfs/filesystem_client.go

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

Loading…
Cancel
Save