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

Method PushRevision

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

638// revision syntax couldn't be resolved, such as in non-centralized workflows with
639// push.default = simple. Downstream consumers should consider how to handle this error.
640func (c *Client) PushRevision(ctx context.Context, branch string) (RemoteTrackingRef, error) {
641 revParseOut, err := c.revParse(ctx, "--symbolic-full-name", branch+"@{push}")
642 if err != nil {
643 return RemoteTrackingRef{}, err
644 }
645
646 ref, err := ParseRemoteTrackingRef(firstLine(revParseOut))
647 if err != nil {
648 return RemoteTrackingRef{}, fmt.Errorf("could not parse push revision: %v", err)
649 }
650
651 return ref, nil
652}
653
654func (c *Client) DeleteLocalTag(ctx context.Context, tag string) error {
655 args := []string{"tag", "-d", tag}

Callers 1

Calls 4

revParseMethod · 0.95
ParseRemoteTrackingRefFunction · 0.85
firstLineFunction · 0.85
ErrorfMethod · 0.65

Tested by 1