MCPcopy Create free account
hub / github.com/cli/cli / Fetch

Method Fetch

git/client.go:880–893  ·  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

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

Callers 1

TestClientFetchFunction · 0.95

Calls 2

AuthenticatedCommandMethod · 0.95
RunMethod · 0.65

Tested by 1

TestClientFetchFunction · 0.76