MCPcopy
hub / github.com/cli/cli / linkedBranchRepoFromURL

Function linkedBranchRepoFromURL

pkg/cmd/issue/develop/develop.go:274–285  ·  view source on GitHub ↗
(branchURL string)

Source from the content-addressed store, hash-verified

272}
273
274func linkedBranchRepoFromURL(branchURL string) (ghrepo.Interface, error) {
275 u, err := url.Parse(branchURL)
276 if err != nil {
277 return nil, err
278 }
279 pathParts := strings.SplitN(strings.Trim(u.Path, "/"), "/", 3)
280 if len(pathParts) < 2 {
281 return nil, fmt.Errorf("invalid linked branch URL: %q", branchURL)
282 }
283 u.Path = "/" + strings.Join(pathParts[0:2], "/")
284 return ghrepo.FromURL(u)
285}
286
287func developRunList(opts *DevelopOptions, apiClient *api.Client, issueRepo ghrepo.Interface, issue *api.Issue) error {
288 opts.IO.StartProgressIndicatorWithLabel("Fetching linked branches")

Callers 1

Calls 3

FromURLFunction · 0.92
JoinMethod · 0.80
ErrorfMethod · 0.65

Tested by

no test coverage detected