(cmd *cobra.Command, project string)
| 45 | } |
| 46 | |
| 47 | func runGetBranch(cmd *cobra.Command, project string) error { |
| 48 | opts := new(gitlab.ListBranchesOptions) |
| 49 | if cmd.Flag("page").Changed { |
| 50 | opts.Page = getFlagInt(cmd, "page") |
| 51 | } |
| 52 | if cmd.Flag("per-page").Changed { |
| 53 | opts.PerPage = getFlagInt(cmd, "per-page") |
| 54 | } |
| 55 | branches, err := getBranch(project, opts) |
| 56 | if err != nil { |
| 57 | return err |
| 58 | } |
| 59 | printBranchOut(getFlagString(cmd, "out"), branches...) |
| 60 | return nil |
| 61 | } |
| 62 | |
| 63 | func getBranch(project string, opts *gitlab.ListBranchesOptions) ([]*gitlab.Branch, error) { |
| 64 | git, err := newGitlabClient() |
no test coverage detected