(
request: WipCaptureRequest<'_>,
prepared: PreparedWip,
)
| 191 | } |
| 192 | |
| 193 | fn create_prepared_capture( |
| 194 | request: WipCaptureRequest<'_>, |
| 195 | prepared: PreparedWip, |
| 196 | ) -> Result<WipCapture, WipCaptureError> { |
| 197 | ensure_head_unchanged(request.repository_root, &prepared.parent_oid)?; |
| 198 | let commit_oid = create_recovery_commit( |
| 199 | request.repository_root, |
| 200 | &prepared.tree_oid, |
| 201 | prepared.parent_oid.as_deref(), |
| 202 | )?; |
| 203 | ensure_head_unchanged(request.repository_root, &prepared.parent_oid)?; |
| 204 | |
| 205 | let ref_name = recovery_ref_name(request.workspace, request.operation); |
| 206 | create_recovery_ref(request.repository_root, &ref_name, &commit_oid)?; |
| 207 | Ok(WipCapture { |
| 208 | ref_name, |
| 209 | commit_oid, |
| 210 | tree_oid: prepared.tree_oid, |
| 211 | parent_oid: prepared.parent_oid, |
| 212 | paths: prepared.paths, |
| 213 | }) |
| 214 | } |
| 215 | |
| 216 | fn reuse_prepared_capture( |
| 217 | root: &Path, |
no test coverage detected