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

Method LastCommit

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

Source from the content-addressed store, hash-verified

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

Callers 1

TestClientLastCommitFunction · 0.95

Calls 1

lookupCommitMethod · 0.95

Tested by 1

TestClientLastCommitFunction · 0.76