@@ -13,7 +13,6 @@ import (
13
13
"github.com/qri-io/dag"
14
14
"github.com/qri-io/dag/dsync"
15
15
"github.com/qri-io/qri/actions"
16
- "github.com/qri-io/qri/base/fill"
17
16
"github.com/qri-io/qri/p2p"
18
17
"github.com/qri-io/qri/repo"
19
18
@@ -91,27 +90,11 @@ func (r *RemoteRequests) PushToRemote(p *PushParams, out *bool) error {
91
90
return fmt .Errorf ("error code %d: %v" , res .StatusCode , rejectionReason (res .Body ))
92
91
}
93
92
94
- bodyBytes , err := ioutil .ReadAll (res .Body )
95
- if err != nil {
96
- return err
97
- }
98
-
99
- var bodyResponse map [string ]interface {}
100
- err = json .Unmarshal (bodyBytes , & bodyResponse )
101
- if err != nil {
102
- return err
103
- }
104
-
105
- dataResponse , ok := bodyResponse ["data" ].(map [string ]interface {})
106
- if ! ok {
107
- return fmt .Errorf ("expected: data json" )
108
- }
109
-
110
- var result ReceiveResult
111
- err = fill .Struct (dataResponse , & result )
112
- if err != nil {
93
+ env := struct {Data ReceiveResult }{}
94
+ if err := json .NewDecoder (res .Body ).Decode (& env ); err != nil {
113
95
return err
114
96
}
97
+ res .Body .Close ()
115
98
116
99
ctx := context .Background ()
117
100
@@ -129,7 +112,7 @@ func (r *RemoteRequests) PushToRemote(p *PushParams, out *bool) error {
129
112
return err
130
113
}
131
114
132
- err = send .PerformSend (result . SessionID , dinfo .Manifest , result .Diff )
115
+ err = send .PerformSend (env . Data . SessionID , dinfo .Manifest , env . Data .Diff )
133
116
if err != nil {
134
117
return err
135
118
}
0 commit comments