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