| 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} |
| 912 | cmd, err := c.AuthenticatedCommand(ctx, AllMatchingCredentialsPattern, args...) |
| 913 | if err != nil { |
| 914 | return err |
| 915 | } |
| 916 | for _, mod := range mods { |
| 917 | mod(cmd) |
| 918 | } |
| 919 | return cmd.Run() |
| 920 | } |
| 921 | |
| 922 | func (c *Client) Clone(ctx context.Context, cloneURL string, args []string, mods ...CommandModifier) (string, error) { |
| 923 | // Note that even if this is an SSH clone URL, we are setting the pattern anyway. |