refactor: extract shared patch helpers#316
Conversation
b7f7160 to
56a7c56
Compare
Greptile SummaryThis PR extracts five focused helper modules (
Confidence Score: 5/5Safe to merge — pure refactoring with identical logic in all moved functions, full test suite passing, and one net-new test for the noprefix normalization improvement. Every extracted function is a byte-for-byte move of existing logic. The only intentional behavioral change — running normalizePatchText in createHunkDiffFilesFromPatch — is additive and directly covered by the new OpenTUI test. The findPatchChunk used by model.ts now uses slightly more robust matching from chunks.ts, which is strictly a superset of the old direct-path matching. No files require special attention; the most structurally significant changes are src/core/loaders.ts (large deletion) and src/opentui/model.ts (behavioral improvement), both of which look correct. Important Files Changed
Reviews (1): Last reviewed commit: "refactor: extract shared patch helpers" | Re-trigger Greptile |
Summary
Verification
bun run typecheckbun run format:checkbun run lintbun test src/core/patch/gitLog.test.ts src/core/loaders.test.ts src/opentui/HunkDiffView.test.tsx src/core/pager.test.ts src/core/vcs/git.test.tsbun test(543 pass, 9 skipped)This PR description was generated by Pi using OpenAI GPT-5.1