MCPcopy Index your code
hub / github.com/devopsctl/gitlabctl / runGetBranch

Function runGetBranch

cmd/get_branch.go:47–61  ·  view source on GitHub ↗
(cmd *cobra.Command, project string)

Source from the content-addressed store, hash-verified

45}
46
47func 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
63func getBranch(project string, opts *gitlab.ListBranchesOptions) ([]*gitlab.Branch, error) {
64 git, err := newGitlabClient()

Callers 1

get_branch.goFile · 0.85

Calls 4

getFlagIntFunction · 0.85
getBranchFunction · 0.85
printBranchOutFunction · 0.85
getFlagStringFunction · 0.85

Tested by

no test coverage detected