(self, operation: ApplyPatchOperation)
| 37 | self._auto_approve = auto_approve or os.environ.get("APPLY_PATCH_AUTO_APPROVE") == "1" |
| 38 | |
| 39 | def create_file(self, operation: ApplyPatchOperation) -> ApplyPatchResult: |
| 40 | relative = self._relative_path(operation.path) |
| 41 | self._require_approval(operation, relative) |
| 42 | target = self._resolve(operation.path, ensure_parent=True) |
| 43 | diff = operation.diff or "" |
| 44 | content = apply_diff("", diff, mode="create") |
| 45 | target.write_text(content, encoding="utf-8") |
| 46 | return ApplyPatchResult(output=f"Created {relative}") |
| 47 | |
| 48 | def update_file(self, operation: ApplyPatchOperation) -> ApplyPatchResult: |
| 49 | relative = self._relative_path(operation.path) |
nothing calls this directly
no test coverage detected