MCPcopy
hub / github.com/cli/cli / PushRevision

Method PushRevision

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

576// revision syntax couldn't be resolved, such as in non-centralized workflows with
577// push.default = simple. Downstream consumers should consider how to handle this error.
578func (c *Client) PushRevision(ctx context.Context, branch string) (RemoteTrackingRef, error) {
579 revParseOut, err := c.revParse(ctx, "--symbolic-full-name", branch+"@{push}")
580 if err != nil {
581 return RemoteTrackingRef{}, err
582 }
583
584 ref, err := ParseRemoteTrackingRef(firstLine(revParseOut))
585 if err != nil {
586 return RemoteTrackingRef{}, fmt.Errorf("could not parse push revision: %v", err)
587 }
588
589 return ref, nil
590}
591
592func (c *Client) DeleteLocalTag(ctx context.Context, tag string) error {
593 args := []string{"tag", "-d", tag}

Callers 1

Calls 4

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

Tested by 1