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