MCPcopy
hub / github.com/cli/cli / Fetch

Method Fetch

git/client.go:818–831  ·  view source on GitHub ↗

Below are commands that make network calls and need authentication credentials supplied from gh.

(ctx context.Context, remote string, refspec string, mods ...CommandModifier)

Source from the content-addressed store, hash-verified

816// Below are commands that make network calls and need authentication credentials supplied from gh.
817
818func (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
833func (c *Client) Pull(ctx context.Context, remote, branch string, mods ...CommandModifier) error {
834 args := []string{"pull", "--ff-only"}

Callers 1

TestClientFetchFunction · 0.95

Calls 2

AuthenticatedCommandMethod · 0.95
RunMethod · 0.65

Tested by 1

TestClientFetchFunction · 0.76