MCPcopy Index your code
hub / github.com/cli/cli / branchFunc

Function branchFunc

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

Source from the content-addressed store, hash-verified

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