MCPcopy
hub / github.com/cli/cli / PopulateSelectedRepositoryInformation

Function PopulateSelectedRepositoryInformation

pkg/cmd/variable/shared/shared.go:79–92  ·  view source on GitHub ↗
(apiClient *api.Client, host string, variable *Variable)

Source from the content-addressed store, hash-verified

77}
78
79func PopulateSelectedRepositoryInformation(apiClient *api.Client, host string, variable *Variable) error {
80 if variable.SelectedReposURL == "" {
81 return nil
82 }
83
84 response := struct {
85 TotalCount int `json:"total_count"`
86 }{}
87 if err := apiClient.REST(host, "GET", variable.SelectedReposURL, nil, &response); err != nil {
88 return fmt.Errorf("failed determining selected repositories for %s: %w", variable.Name, err)
89 }
90 variable.NumSelectedRepos = response.TotalCount
91 return nil
92}

Callers 2

getRunFunction · 0.92

Calls 2

RESTMethod · 0.65
ErrorfMethod · 0.65

Tested by

no test coverage detected