| 831 | } |
| 832 | |
| 833 | func (c *Client) Pull(ctx context.Context, remote, branch string, mods ...CommandModifier) error { |
| 834 | args := []string{"pull", "--ff-only"} |
| 835 | if remote != "" && branch != "" { |
| 836 | args = append(args, remote, branch) |
| 837 | } |
| 838 | cmd, err := c.AuthenticatedCommand(ctx, AllMatchingCredentialsPattern, args...) |
| 839 | if err != nil { |
| 840 | return err |
| 841 | } |
| 842 | for _, mod := range mods { |
| 843 | mod(cmd) |
| 844 | } |
| 845 | return cmd.Run() |
| 846 | } |
| 847 | |
| 848 | func (c *Client) Push(ctx context.Context, remote string, ref string, mods ...CommandModifier) error { |
| 849 | args := []string{"push", "--set-upstream", remote, ref} |