(repoDir, commit string)
| 25 | } |
| 26 | |
| 27 | func getCommitMessage(repoDir, commit string) (string, error) { |
| 28 | // stdout only: CombinedOutput would prepend git warnings / GIT_TRACE |
| 29 | // lines to the commit message, which ocr review --commit then sends |
| 30 | // to the LLM as the review background. |
| 31 | out, err := runGitCmdStdout(repoDir, "log", "-1", "--format=%B", "--end-of-options", commit) |
| 32 | if err != nil { |
| 33 | return "", fmt.Errorf("git log failed: %w", err) |
| 34 | } |
| 35 | return strings.TrimSpace(string(out)), nil |
| 36 | } |