MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / create_prepared_capture

Function create_prepared_capture

atomic-repository/src/wip.rs:193–214  ·  view source on GitHub ↗
(
    request: WipCaptureRequest<'_>,
    prepared: PreparedWip,
)

Source from the content-addressed store, hash-verified

191}
192
193fn 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
216fn reuse_prepared_capture(
217 root: &Path,

Callers 2

capture_tracked_wipFunction · 0.85

Calls 4

ensure_head_unchangedFunction · 0.85
create_recovery_commitFunction · 0.85
recovery_ref_nameFunction · 0.85
create_recovery_refFunction · 0.85

Tested by

no test coverage detected