(ctx context.Context)
| 409 | } |
| 410 | |
| 411 | func (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 | |
| 423 | func (c *Client) CommitBody(ctx context.Context, sha string) (string, error) { |
| 424 | output, err := c.lookupCommit(ctx, sha, "%b") |