MCPcopy Create free account
hub / github.com/OctopusDeploy/cli / selectGitReference

Function selectGitReference

pkg/cmd/release/create/create.go:702–719  ·  view source on GitHub ↗
(octopus *octopusApiClient.Client, ask question.Asker, project *projects.Project)

Source from the content-addressed store, hash-verified

700}
701
702func selectGitReference(octopus *octopusApiClient.Client, ask question.Asker, project *projects.Project) (*projects.GitReference, error) {
703 branches, err := octopus.Projects.GetGitBranches(project)
704 if err != nil {
705 return nil, err
706 }
707
708 tags, err := octopus.Projects.GetGitTags(project)
709
710 if err != nil {
711 return nil, err
712 }
713
714 allRefs := append(branches, tags...)
715
716 return question.SelectMap(ask, "Select the Git Reference to use", allRefs, func(g *projects.GitReference) string {
717 return fmt.Sprintf("%s %s", g.Name, output.Dimf("(%s)", g.Type.Description()))
718 })
719}

Callers 1

AskQuestionsFunction · 0.85

Calls 2

SelectMapFunction · 0.92
DimfFunction · 0.92

Tested by

no test coverage detected