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

Method Push

git/client.go:911–921  ·  view source on GitHub ↗
(ctx context.Context, remote string, ref string, mods ...CommandModifier)

Source from the content-addressed store, hash-verified

909}
910
911func (c *Client) Push(ctx context.Context, remote string, ref string, mods ...CommandModifier) error {
912 args := []string{"push", "--set-upstream", remote, ref}
913 cmd, err := c.AuthenticatedCommand(ctx, AllMatchingCredentialsPattern, args...)
914 if err != nil {
915 return err
916 }
917 for _, mod := range mods {
918 mod(cmd)
919 }
920 return cmd.Run()
921}
922
923func (c *Client) Clone(ctx context.Context, cloneURL string, args []string, mods ...CommandModifier) (string, error) {
924 // Note that even if this is an SSH clone URL, we are setting the pattern anyway.

Callers 4

TestClientPushFunction · 0.95
createFromLocalFunction · 0.80
ensurePushedFunction · 0.80
handlePushFunction · 0.80

Calls 2

AuthenticatedCommandMethod · 0.95
RunMethod · 0.65

Tested by 1

TestClientPushFunction · 0.76