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

Method SetBranchConfig

git/client.go:493–503  ·  view source on GitHub ↗

SetBranchConfig sets the named value on the given branch.

(ctx context.Context, branch, name, value string)

Source from the content-addressed store, hash-verified

491
492// SetBranchConfig sets the named value on the given branch.
493func (c *Client) SetBranchConfig(ctx context.Context, branch, name, value string) error {
494 name = fmt.Sprintf("branch.%s.%s", branch, name)
495 args := []string{"config", name, value}
496 cmd, err := c.Command(ctx, args...)
497 if err != nil {
498 return err
499 }
500 // No output expected but check for any printed git error.
501 _, err = cmd.Output()
502 return err
503}
504
505// PushDefault defines the action git push should take if no refspec is given.
506// See: https://git-scm.com/docs/git-config#Documentation/git-config.txt-pushdefault

Callers 1

developRunCreateFunction · 0.80

Calls 2

CommandMethod · 0.95
OutputMethod · 0.65

Tested by

no test coverage detected