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§
- Branch
Update - Information about a branch update during repair.
- Repair
Options - Options for repository repair.
- Repair
Preview - Preview of what a repair operation would do (for dry-run).
- Repair
Result - Result of a repair operation.
Enums§
- Repair
Mode - 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.