SetBranchConfig sets the named value on the given branch.
(ctx context.Context, branch, name, value string)
| 491 | |
| 492 | // SetBranchConfig sets the named value on the given branch. |
| 493 | func (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 |
no test coverage detected