MCPcopy Index your code
hub / github.com/cli/cli / Push

Method Push

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

Source from the content-addressed store, hash-verified

846}
847
848func (c *Client) Push(ctx context.Context, remote string, ref string, mods ...CommandModifier) error {
849 args := []string{"push", "--set-upstream", remote, ref}
850 cmd, err := c.AuthenticatedCommand(ctx, AllMatchingCredentialsPattern, args...)
851 if err != nil {
852 return err
853 }
854 for _, mod := range mods {
855 mod(cmd)
856 }
857 return cmd.Run()
858}
859
860func (c *Client) Clone(ctx context.Context, cloneURL string, args []string, mods ...CommandModifier) (string, error) {
861 // 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