SetBranchConfig sets the named value on the given branch.
(ctx context.Context, branch, name, value string)
| 485 | |
| 486 | // SetBranchConfig sets the named value on the given branch. |
| 487 | func (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 |