| 893 | } |
| 894 | |
| 895 | func (c *Client) Pull(ctx context.Context, remote, branch string, mods ...CommandModifier) error { |
| 896 | args := []string{"pull", "--ff-only"} |
| 897 | if remote != "" && branch != "" { |
| 898 | args = append(args, remote, branch) |
| 899 | } |
| 900 | cmd, err := c.AuthenticatedCommand(ctx, AllMatchingCredentialsPattern, args...) |
| 901 | if err != nil { |
| 902 | return err |
| 903 | } |
| 904 | for _, mod := range mods { |
| 905 | mod(cmd) |
| 906 | } |
| 907 | return cmd.Run() |
| 908 | } |
| 909 | |
| 910 | func (c *Client) Push(ctx context.Context, remote string, ref string, mods ...CommandModifier) error { |
| 911 | args := []string{"push", "--set-upstream", remote, ref} |