(httpClient *http.Client, repo ghrepo.Interface)
| 421 | } |
| 422 | |
| 423 | func CanPushToRepo(httpClient *http.Client, repo ghrepo.Interface) (bool, error) { |
| 424 | if r, ok := repo.(*Repository); ok && r.ViewerPermission != "" { |
| 425 | return r.ViewerCanPush(), nil |
| 426 | } |
| 427 | |
| 428 | apiClient := NewClientFromHTTP(httpClient) |
| 429 | r, err := GitHubRepo(apiClient, repo) |
| 430 | if err != nil { |
| 431 | return false, err |
| 432 | } |
| 433 | return r.ViewerCanPush(), nil |
| 434 | } |
| 435 | |
| 436 | // RepoParent finds out the parent repository of a fork |
| 437 | func RepoParent(client *Client, repo ghrepo.Interface) (ghrepo.Interface, error) { |
nothing calls this directly
no test coverage detected