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

Method RemotePushDefault

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

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

Callers

nothing calls this directly

Calls 1

ConfigMethod · 0.95

Tested by

no test coverage detected