MCPcopy
hub / github.com/cli/cli / RepoGitIgnoreTemplates

Function RepoGitIgnoreTemplates

api/queries_repo.go:1715–1723  ·  view source on GitHub ↗

RepoGitIgnoreTemplates fetches available repository gitignore templates. It uses API v3 here because gitignore template isn't supported by GraphQL.

(httpClient *http.Client, hostname string)

Source from the content-addressed store, hash-verified

1713// RepoGitIgnoreTemplates fetches available repository gitignore templates.
1714// It uses API v3 here because gitignore template isn't supported by GraphQL.
1715func RepoGitIgnoreTemplates(httpClient *http.Client, hostname string) ([]string, error) {
1716 var gitIgnoreTemplates []string
1717 client := NewClientFromHTTP(httpClient)
1718 err := client.REST(hostname, "GET", "gitignore/templates", nil, &gitIgnoreTemplates)
1719 if err != nil {
1720 return nil, err
1721 }
1722 return gitIgnoreTemplates, nil
1723}
1724
1725// RepoGitIgnoreTemplate fetches an available repository gitignore template.
1726// It uses API v3 here because gitignore template isn't supported by GraphQL.

Callers 4

listRunFunction · 0.92
NewCmdCreateFunction · 0.92
interactiveGitIgnoreFunction · 0.92

Calls 2

NewClientFromHTTPFunction · 0.85
RESTMethod · 0.65