MCPcopy Create free account
hub / github.com/devopsctl/gitlabctl / runNewBranch

Function runNewBranch

cmd/new_branch.go:51–61  ·  view source on GitHub ↗
(cmd *cobra.Command, branch string)

Source from the content-addressed store, hash-verified

49}
50
51func 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
63func newBranch(project string, opts *gitlab.CreateBranchOptions) (*gitlab.Branch, error) {
64 git, err := newGitlabClient()

Callers 1

new_branch.goFile · 0.85

Calls 3

getFlagStringFunction · 0.85
newBranchFunction · 0.85
printBranchOutFunction · 0.85

Tested by

no test coverage detected