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

Method SetBranchConfig

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

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