(ctx context.Context)
| 347 | } |
| 348 | |
| 349 | func (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 | |
| 361 | func (c *Client) CommitBody(ctx context.Context, sha string) (string, error) { |
| 362 | output, err := c.lookupCommit(ctx, sha, "%b") |