Skip to main content

verify_file_rollback

Function verify_file_rollback 

Source
pub async fn verify_file_rollback(
    pkg_path: &Path,
    file_name: &str,
    file_info: &PatchFileInfo,
    blobs_path: &Path,
) -> VerifyRollbackResult
Expand description

Verify a single file can be rolled back.

A file is ready for rollback if:

  1. The file exists on disk.
  2. Its current hash matches the afterHash (patched state).
  3. The before-hash blob exists in the blobs directory.

A file whose current hash already matches the beforeHash is reported AlreadyOriginal before the blob is checked — a finished rollback is a no-op and must not be blocked by a missing (e.g. GC’d) blob it would never need to read.