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