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