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

Method PushRevision

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

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

Callers 1

Calls 4

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

Tested by 1