MCPcopy Create free account
hub / github.com/GongShichen/LuminaCode / patchApplyCheck

Function patchApplyCheck

benchmark/agentbench/runner.go:211–218  ·  view source on GitHub ↗
(ctx context.Context, dir, patchPath string)

Source from the content-addressed store, hash-verified

209func patchApplyCheck(ctx context.Context, dir, patchPath string) bool {
210 data, err := os.ReadFile(patchPath)
211 if err != nil || strings.TrimSpace(string(data)) == "" {
212 return false
213 }
214 result := RunShellCommand(ctx, dir, "git apply --check "+shellQuote(patchPath), 30*time.Second)
215 return result.ExitCode == 0
216}
217
218func writeCaseArtifacts(dir string, c CaseSpec, agentResult AgentRunResult, result CaseResult) {
219 _ = os.MkdirAll(dir, 0o755)
220 setArtifactPaths(&result, dir)
221 _ = os.WriteFile(result.PromptPath, []byte(c.Prompt), 0o644)

Callers 1

runCaseFunction · 0.85

Calls 2

RunShellCommandFunction · 0.85
shellQuoteFunction · 0.85

Tested by

no test coverage detected