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

Method LastCommit

git/client.go:411–421  ·  view source on GitHub ↗
(ctx context.Context)

Source from the content-addressed store, hash-verified

409}
410
411func (c *Client) LastCommit(ctx context.Context) (*Commit, error) {
412 output, err := c.lookupCommit(ctx, "HEAD", "%H,%s")
413 if err != nil {
414 return nil, err
415 }
416 idx := bytes.IndexByte(output, ',')
417 return &Commit{
418 Sha: string(output[0:idx]),
419 Title: strings.TrimSpace(string(output[idx+1:])),
420 }, nil
421}
422
423func (c *Client) CommitBody(ctx context.Context, sha string) (string, error) {
424 output, err := c.lookupCommit(ctx, sha, "%b")

Callers 1

TestClientLastCommitFunction · 0.95

Calls 1

lookupCommitMethod · 0.95

Tested by 1

TestClientLastCommitFunction · 0.76