Below are commands that make network calls and need authentication credentials supplied from gh.
(ctx context.Context, remote string, refspec string, mods ...CommandModifier)
| 816 | // Below are commands that make network calls and need authentication credentials supplied from gh. |
| 817 | |
| 818 | func (c *Client) Fetch(ctx context.Context, remote string, refspec string, mods ...CommandModifier) error { |
| 819 | args := []string{"fetch", remote} |
| 820 | if refspec != "" { |
| 821 | args = append(args, refspec) |
| 822 | } |
| 823 | cmd, err := c.AuthenticatedCommand(ctx, AllMatchingCredentialsPattern, args...) |
| 824 | if err != nil { |
| 825 | return err |
| 826 | } |
| 827 | for _, mod := range mods { |
| 828 | mod(cmd) |
| 829 | } |
| 830 | return cmd.Run() |
| 831 | } |
| 832 | |
| 833 | func (c *Client) Pull(ctx context.Context, remote, branch string, mods ...CommandModifier) error { |
| 834 | args := []string{"pull", "--ff-only"} |