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

Method SetBranchConfig

git/client.go:487–497  ·  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

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

Calls 2

CommandMethod · 0.95
OutputMethod · 0.65