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

Function developRunList

pkg/cmd/issue/develop/develop.go:319–340  ·  view source on GitHub ↗
(opts *DevelopOptions, apiClient *api.Client, issueRepo ghrepo.Interface, issue *api.Issue)

Source from the content-addressed store, hash-verified

317}
318
319func developRunList(opts *DevelopOptions, apiClient *api.Client, issueRepo ghrepo.Interface, issue *api.Issue) error {
320 opts.IO.StartProgressIndicatorWithLabel("Fetching linked branches")
321 defer opts.IO.StopProgressIndicator()
322
323 branches, err := api.ListLinkedBranches(apiClient, issueRepo, issue.Number)
324 if err != nil {
325 return err
326 }
327 opts.IO.StopProgressIndicator()
328
329 if len(branches) == 0 {
330 return cmdutil.NewNoResultsError(fmt.Sprintf("no linked branches found for %s#%d", ghrepo.FullName(issueRepo), issue.Number))
331 }
332
333 if opts.IO.IsStdoutTTY() {
334 fmt.Fprintf(opts.IO.Out, "\nShowing linked branches for %s#%d\n\n", ghrepo.FullName(issueRepo), issue.Number)
335 }
336
337 printLinkedBranches(opts.IO, branches)
338
339 return nil
340}
341
342func printLinkedBranches(io *iostreams.IOStreams, branches []api.LinkedBranch) {
343 cs := io.ColorScheme()

Callers 1

developRunFunction · 0.85

Calls 7

ListLinkedBranchesFunction · 0.92
NewNoResultsErrorFunction · 0.92
FullNameFunction · 0.92
printLinkedBranchesFunction · 0.85
IsStdoutTTYMethod · 0.80
StopProgressIndicatorMethod · 0.65

Tested by

no test coverage detected