RepoGitIgnoreTemplates fetches available repository gitignore templates. It uses API v3 here because gitignore template isn't supported by GraphQL.
(httpClient *http.Client, hostname string)
| 1713 | // RepoGitIgnoreTemplates fetches available repository gitignore templates. |
| 1714 | // It uses API v3 here because gitignore template isn't supported by GraphQL. |
| 1715 | func 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. |