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