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

Function branchFunc

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

Source from the content-addressed store, hash-verified

331}
332
333func branchFunc(f *cmdutil.Factory) func() (string, error) {
334 return func() (string, error) {
335 currentBranch, err := f.GitClient.CurrentBranch(context.Background())
336 if err != nil {
337 return "", fmt.Errorf("could not determine current branch: %w", err)
338 }
339 return currentBranch, nil
340 }
341}
342
343func extensionManager(f *cmdutil.Factory) *extension.Manager {
344 em := extension.NewManager(f.IOStreams, f.GitClient, f.ExecutablePath)

Callers 1

NewFunction · 0.85

Calls 2

CurrentBranchMethod · 0.65
ErrorfMethod · 0.65

Tested by

no test coverage detected