MCPcopy Create free account
hub / github.com/cli/cli / linkedBranchRepoFromURL

Function linkedBranchRepoFromURL

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

Source from the content-addressed store, hash-verified

304}
305
306func linkedBranchRepoFromURL(branchURL string) (ghrepo.Interface, error) {
307 u, err := url.Parse(branchURL)
308 if err != nil {
309 return nil, err
310 }
311 pathParts := strings.SplitN(strings.Trim(u.Path, "/"), "/", 3)
312 if len(pathParts) < 2 {
313 return nil, fmt.Errorf("invalid linked branch URL: %q", branchURL)
314 }
315 u.Path = "/" + strings.Join(pathParts[0:2], "/")
316 return ghrepo.FromURL(u)
317}
318
319func developRunList(opts *DevelopOptions, apiClient *api.Client, issueRepo ghrepo.Interface, issue *api.Issue) error {
320 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