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

Method RemotePushDefault

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

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

Callers 1

Calls 1

ConfigMethod · 0.95

Tested by 1