aboutsummaryrefslogtreecommitdiffstats
path: root/remote.go
diff options
context:
space:
mode:
Diffstat (limited to 'remote.go')
-rw-r--r--remote.go15
1 files changed, 13 insertions, 2 deletions
diff --git a/remote.go b/remote.go
index bfa7bc9..c654422 100644
--- a/remote.go
+++ b/remote.go
@@ -161,9 +161,20 @@ func (r *Remote) buildRequest(
}
func (r *Remote) updateObjectStorage(reader io.Reader) error {
- stream := packfile.NewScannerFromReader(reader)
+ s := r.s.ObjectStorage()
+ if sw, ok := s.(core.ObjectStorageWrite); ok {
+ w, err := sw.Writer()
+ if err != nil {
+ return err
+ }
+
+ defer w.Close()
+ _, err = io.Copy(w, reader)
+ return err
+ }
- d := packfile.NewDecoder(stream, r.s.ObjectStorage())
+ stream := packfile.NewScannerFromReader(reader)
+ d := packfile.NewDecoder(stream, s)
_, err := d.Decode()
return err
}