(baselineCommit: string)
| 222 | } |
| 223 | |
| 224 | async function generateDiff(baselineCommit: string) { |
| 225 | let diff; |
| 226 | try { |
| 227 | diff = ( |
| 228 | await $`git diff --unified=5 ${baselineCommit} HEAD`.text() |
| 229 | ).trim(); |
| 230 | } catch (e) { |
| 231 | const msg = e instanceof Error ? e.message : String(e); |
| 232 | console.error("Failed to generate diff:", msg); |
| 233 | throw e; |
| 234 | } |
| 235 | |
| 236 | if (diff.length === 0) throw new Error("Diff is empty"); |
| 237 | return diff; |
| 238 | } |
| 239 | |
| 240 | async function judgeScore( |
| 241 | criterionName: string, |