(cmd *cobra.Command, branch string)
| 49 | } |
| 50 | |
| 51 | func runNewBranch(cmd *cobra.Command, branch string) error { |
| 52 | opts := new(gitlab.CreateBranchOptions) |
| 53 | opts.Ref = gitlab.String(getFlagString(cmd, "ref")) |
| 54 | opts.Branch = gitlab.String(branch) |
| 55 | createdBranch, err := newBranch(getFlagString(cmd, "project"), opts) |
| 56 | if err != nil { |
| 57 | return err |
| 58 | } |
| 59 | printBranchOut(getFlagString(cmd, "out"), createdBranch) |
| 60 | return nil |
| 61 | } |
| 62 | |
| 63 | func newBranch(project string, opts *gitlab.CreateBranchOptions) (*gitlab.Branch, error) { |
| 64 | git, err := newGitlabClient() |
no test coverage detected