(client *Client, repo ghrepo.Interface)
| 409 | } |
| 410 | |
| 411 | func RepoDefaultBranch(client *Client, repo ghrepo.Interface) (string, error) { |
| 412 | if r, ok := repo.(*Repository); ok && r.DefaultBranchRef.Name != "" { |
| 413 | return r.DefaultBranchRef.Name, nil |
| 414 | } |
| 415 | |
| 416 | r, err := GitHubRepo(client, repo) |
| 417 | if err != nil { |
| 418 | return "", err |
| 419 | } |
| 420 | return r.DefaultBranchRef.Name, nil |
| 421 | } |
| 422 | |
| 423 | func CanPushToRepo(httpClient *http.Client, repo ghrepo.Interface) (bool, error) { |
| 424 | if r, ok := repo.(*Repository); ok && r.ViewerPermission != "" { |
no test coverage detected