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

Method PushRevision

git/client.go:634–641  ·  view source on GitHub ↗

PushRevision gets the value of the @{push} revision syntax An error here doesn't necessarily mean something is broken, but may mean that the @{push} revision syntax couldn't be resolved, such as in non-centralized workflows with push.default = simple. Downstream consumers should consider how to hand

(ctx context.Context, branch string)

Source from the content-addressed store, hash-verified

632// revision syntax couldn't be resolved, such as in non-centralized workflows with
633// push.default = simple. Downstream consumers should consider how to handle this error.
634func (c *Client) PushRevision(ctx context.Context, branch string) (RemoteTrackingRef, error) {
635 revParseOut, err := c.revParse(ctx, "--symbolic-full-name", branch+"@{push}")
636 if err != nil {
637 return RemoteTrackingRef{}, err
638 }
639
640 return parsePushRevision(revParseOut)
641}
642
643func parsePushRevision(revParseOut []byte) (RemoteTrackingRef, error) {
644 ref, err := ParseRemoteTrackingRef(firstLine(revParseOut))

Callers

nothing calls this directly

Calls 2

revParseMethod · 0.95
parsePushRevisionFunction · 0.85

Tested by

no test coverage detected