pub fn apply_patch(dir: &Path, patch: &str) -> Result<()>Expand description
Apply the proposed patch inside an isolated directory. Strategy:
- Try real
git apply(best when the patch was generated with context). - Fall back to smart string replacement for the common Rig preamble/tool cases.
This keeps the system reliable even when perfect unified diffs are hard to generate.