mirror of https://gitlab.com/gitlab-org/cli.git
16 lines
356 B
Go
16 lines
356 B
Go
package api
|
|
|
|
import "github.com/xanzy/go-gitlab"
|
|
|
|
var CreateBranch = func(client *gitlab.Client, projectID interface{}, opts *gitlab.CreateBranchOptions) (*gitlab.Branch, error) {
|
|
if client == nil {
|
|
client = apiClient.Lab()
|
|
}
|
|
branch, _, err := client.Branches.CreateBranch(projectID, opts)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
|
|
return branch, nil
|
|
}
|