Below are commands that make network calls and need authentication credentials supplied from gh.
(ctx context.Context, remote string, refspec string, mods ...CommandModifier)
| 878 | // Below are commands that make network calls and need authentication credentials supplied from gh. |
| 879 | |
| 880 | func (c *Client) Fetch(ctx context.Context, remote string, refspec string, mods ...CommandModifier) error { |
| 881 | args := []string{"fetch", remote} |
| 882 | if refspec != "" { |
| 883 | args = append(args, refspec) |
| 884 | } |
| 885 | cmd, err := c.AuthenticatedCommand(ctx, AllMatchingCredentialsPattern, args...) |
| 886 | if err != nil { |
| 887 | return err |
| 888 | } |
| 889 | for _, mod := range mods { |
| 890 | mod(cmd) |
| 891 | } |
| 892 | return cmd.Run() |
| 893 | } |
| 894 | |
| 895 | func (c *Client) Pull(ctx context.Context, remote, branch string, mods ...CommandModifier) error { |
| 896 | args := []string{"pull", "--ff-only"} |