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

Method SetBranchConfig

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

429
430// SetBranchConfig sets the named value on the given branch.
431func (c *Client) SetBranchConfig(ctx context.Context, branch, name, value string) error {
432 name = fmt.Sprintf("branch.%s.%s", branch, name)
433 args := []string{"config", name, value}
434 cmd, err := c.Command(ctx, args...)
435 if err != nil {
436 return err
437 }
438 // No output expected but check for any printed git error.
439 _, err = cmd.Output()
440 return err
441}
442
443// PushDefault defines the action git push should take if no refspec is given.
444// 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