+1
-14
appview/state/pull.go
+1
-14
appview/state/pull.go
···
247
247
return pages.Unknown
248
248
}
249
249
250
-
resp, err := us.Branch(ownerDid, repoName, pull.PullSource.Branch)
250
+
result, err := us.Branch(ownerDid, repoName, pull.PullSource.Branch)
251
251
if err != nil {
252
252
log.Println("failed to reach knotserver", err)
253
-
return pages.Unknown
254
-
}
255
-
256
-
body, err := io.ReadAll(resp.Body)
257
-
if err != nil {
258
-
log.Printf("error reading response body: %v", err)
259
-
return pages.Unknown
260
-
}
261
-
defer resp.Body.Close()
262
-
263
-
var result types.RepoBranchResponse
264
-
if err := json.Unmarshal(body, &result); err != nil {
265
-
log.Println("failed to parse response:", err)
266
253
return pages.Unknown
267
254
}
268
255
+2
-2
knotclient/unsigned.go
+2
-2
knotclient/unsigned.go
···
142
142
return do[types.RepoTagsResponse](us, req)
143
143
}
144
144
145
-
func (us *UnsignedClient) Branch(ownerDid, repoName, branch string) (*http.Response, error) {
145
+
func (us *UnsignedClient) Branch(ownerDid, repoName, branch string) (*types.RepoBranchResponse, error) {
146
146
const (
147
147
Method = "GET"
148
148
)
···
154
154
return nil, err
155
155
}
156
156
157
-
return us.client.Do(req)
157
+
return do[types.RepoBranchResponse](us, req)
158
158
}
159
159
160
160
func (us *UnsignedClient) DefaultBranch(ownerDid, repoName string) (*types.RepoDefaultBranchResponse, error) {