MCPcopy
hub / github.com/cli/cli / Pull

Method Pull

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

Source from the content-addressed store, hash-verified

831}
832
833func (c *Client) Pull(ctx context.Context, remote, branch string, mods ...CommandModifier) error {
834 args := []string{"pull", "--ff-only"}
835 if remote != "" && branch != "" {
836 args = append(args, remote, branch)
837 }
838 cmd, err := c.AuthenticatedCommand(ctx, AllMatchingCredentialsPattern, args...)
839 if err != nil {
840 return err
841 }
842 for _, mod := range mods {
843 mod(cmd)
844 }
845 return cmd.Run()
846}
847
848func (c *Client) Push(ctx context.Context, remote string, ref string, mods ...CommandModifier) error {
849 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