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

Method RemotePushDefault

git/client.go:555–567  ·  view source on GitHub ↗

RemotePushDefault returns the value of remote.pushDefault in the config. If the value is not set, it returns an empty string.

(ctx context.Context)

Source from the content-addressed store, hash-verified

553// RemotePushDefault returns the value of remote.pushDefault in the config. If
554// the value is not set, it returns an empty string.
555func (c *Client) RemotePushDefault(ctx context.Context) (string, error) {
556 remotePushDefault, err := c.Config(ctx, "remote.pushDefault")
557 if err == nil {
558 return remotePushDefault, nil
559 }
560
561 var gitError *GitError
562 if ok := errors.As(err, &gitError); ok && gitError.ExitCode == 1 {
563 return "", nil
564 }
565
566 return "", err
567}
568
569// RemoteTrackingRef is the structured form of the string "refs/remotes/<remote>/<branch>".
570// For example, the @{push} revision syntax could report "refs/remotes/origin/main" which would

Callers 1

Calls 1

ConfigMethod · 0.95

Tested by 1