MCPcopy Index your code
hub / github.com/cli/cli / LastCommit

Method LastCommit

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

Source from the content-addressed store, hash-verified

347}
348
349func (c *Client) LastCommit(ctx context.Context) (*Commit, error) {
350 output, err := c.lookupCommit(ctx, "HEAD", "%H,%s")
351 if err != nil {
352 return nil, err
353 }
354 idx := bytes.IndexByte(output, ',')
355 return &Commit{
356 Sha: string(output[0:idx]),
357 Title: strings.TrimSpace(string(output[idx+1:])),
358 }, nil
359}
360
361func (c *Client) CommitBody(ctx context.Context, sha string) (string, error) {
362 output, err := c.lookupCommit(ctx, sha, "%b")

Callers 1

TestClientLastCommitFunction · 0.95

Calls 1

lookupCommitMethod · 0.95

Tested by 1

TestClientLastCommitFunction · 0.76