MCPcopy Create free account
hub / github.com/cli/cli / branchFunc

Function branchFunc

pkg/cmd/factory/default.go:263–271  ·  view source on GitHub ↗
(f *cmdutil.Factory)

Source from the content-addressed store, hash-verified

261}
262
263func branchFunc(f *cmdutil.Factory) func() (string, error) {
264 return func() (string, error) {
265 currentBranch, err := f.GitClient.CurrentBranch(context.Background())
266 if err != nil {
267 return "", fmt.Errorf("could not determine current branch: %w", err)
268 }
269 return currentBranch, nil
270 }
271}
272
273func extensionManager(f *cmdutil.Factory) *extension.Manager {
274 em := extension.NewManager(f.IOStreams, f.GitClient)

Callers 1

NewFunction · 0.85

Calls 2

CurrentBranchMethod · 0.65
ErrorfMethod · 0.65

Tested by

no test coverage detected