| 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} |
| 850 | cmd, err := c.AuthenticatedCommand(ctx, AllMatchingCredentialsPattern, args...) |
| 851 | if err != nil { |
| 852 | return err |
| 853 | } |
| 854 | for _, mod := range mods { |
| 855 | mod(cmd) |
| 856 | } |
| 857 | return cmd.Run() |
| 858 | } |
| 859 | |
| 860 | func (c *Client) Clone(ctx context.Context, cloneURL string, args []string, mods ...CommandModifier) (string, error) { |
| 861 | // Note that even if this is an SSH clone URL, we are setting the pattern anyway. |