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

Method Pull

git/client.go:896–909  ·  view source on GitHub ↗
(ctx context.Context, remote, branch string, mods ...CommandModifier)

Source from the content-addressed store, hash-verified

894}
895
896func (c *Client) Pull(ctx context.Context, remote, branch string, mods ...CommandModifier) error {
897 args := []string{"pull", "--ff-only"}
898 if remote != "" && branch != "" {
899 args = append(args, remote, branch)
900 }
901 cmd, err := c.AuthenticatedCommand(ctx, AllMatchingCredentialsPattern, args...)
902 if err != nil {
903 return err
904 }
905 for _, mod := range mods {
906 mod(cmd)
907 }
908 return cmd.Run()
909}
910
911func (c *Client) Push(ctx context.Context, remote string, ref string, mods ...CommandModifier) error {
912 args := []string{"push", "--set-upstream", remote, ref}

Callers 1

TestClientPullFunction · 0.95

Calls 2

AuthenticatedCommandMethod · 0.95
RunMethod · 0.65

Tested by 1

TestClientPullFunction · 0.76