MCPcopy
hub / github.com/cli/cli / RemotePushDefault

Method RemotePushDefault

git/client.go:493–505  ·  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

491// RemotePushDefault returns the value of remote.pushDefault in the config. If
492// the value is not set, it returns an empty string.
493func (c *Client) RemotePushDefault(ctx context.Context) (string, error) {
494 remotePushDefault, err := c.Config(ctx, "remote.pushDefault")
495 if err == nil {
496 return remotePushDefault, nil
497 }
498
499 var gitError *GitError
500 if ok := errors.As(err, &gitError); ok && gitError.ExitCode == 1 {
501 return "", nil
502 }
503
504 return "", err
505}
506
507// RemoteTrackingRef is the structured form of the string "refs/remotes/<remote>/<branch>".
508// For example, the @{push} revision syntax could report "refs/remotes/origin/main" which would

Callers 1

Calls 1

ConfigMethod · 0.95

Tested by 1