Skip to main content

Module repair

Module repair 

Source
Expand description

Repository repair operations.

Provides tools to recover from repository corruption by:

§Repair Modes

§Truncate Mode (RepairMode::Truncate)

The safe, recommended option. Moves HEAD and branch refs to the recovery boundary, discarding broken commits. All healthy history is preserved exactly.

§Rewrite History Mode (RepairMode::RewriteHistory)

Advanced option that rewrites commits from recovery boundary to HEAD, skipping broken ones. Preserves healthy commits that came after broken ones, but invalidates all commit signatures.

§Usage

use void_core::ops::repair::{repair, RepairOptions, RepairMode};

let opts = RepairOptions {
    void_dir: PathBuf::from(".void"),
    key: encryption_key,
    mode: RepairMode::Truncate,
    dry_run: true,  // Preview first
    checkout: false,
};

let result = repair(opts)?;
println!("Would preserve {} commits, discard {}",
    result.commits_preserved, result.commits_discarded);

Structs§

BranchUpdate
Information about a branch update during repair.
RepairOptions
Options for repository repair.
RepairPreview
Preview of what a repair operation would do (for dry-run).
RepairResult
Result of a repair operation.

Enums§

RepairMode
Repair mode determines how corruption is handled.

Functions§

preview_repair
Preview what a repair operation would do.
preview_rewrite
Preview what rewrite repair would do without making changes.
preview_truncate
Preview what truncate repair would do without making changes.
repair
Repair a corrupted repository.
rewrite_skipping_broken
Rewrite commits from HEAD to root, skipping broken ones.
truncate_to_boundary
Truncate repository to recovery boundary or best-effort target.