RepoGitIgnoreTemplates fetches available repository gitignore templates. It uses API v3 here because gitignore template isn't supported by GraphQL.
(httpClient *http.Client, hostname string)
| 1735 | // RepoGitIgnoreTemplates fetches available repository gitignore templates. |
| 1736 | // It uses API v3 here because gitignore template isn't supported by GraphQL. |
| 1737 | func RepoGitIgnoreTemplates(httpClient *http.Client, hostname string) ([]string, error) { |
| 1738 | var gitIgnoreTemplates []string |
| 1739 | client := NewClientFromHTTP(httpClient) |
| 1740 | path, err := safeurl.JoinPath("gitignore", "templates") |
| 1741 | if err != nil { |
| 1742 | return nil, err |
| 1743 | } |
| 1744 | err = client.REST(hostname, "GET", path.String(), nil, &gitIgnoreTemplates) |
| 1745 | if err != nil { |
| 1746 | return nil, err |
| 1747 | } |
| 1748 | return gitIgnoreTemplates, nil |
| 1749 | } |
| 1750 | |
| 1751 | // RepoGitIgnoreTemplate fetches an available repository gitignore template. |
| 1752 | // It uses API v3 here because gitignore template isn't supported by GraphQL. |