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

Function doctor_repair_dependency_index

atomic-cli/src/commands/rpc.rs:3280–3310  ·  view source on GitHub ↗

`atomic doctor repair-dependency-index` over MaintenanceService.Repair.

(
    args: &super::doctor::RepairDependencyIndex,
)

Source from the content-addressed store, hash-verified

3278
3279/// `atomic doctor repair-dependency-index` over MaintenanceService.Repair.
3280pub fn doctor_repair_dependency_index(
3281 args: &super::doctor::RepairDependencyIndex,
3282) -> CliResult<bool> {
3283 let Some(session) = Service::open()? else {
3284 return Ok(false);
3285 };
3286 let request = pb::RepairRequest {
3287 repository: Some(session.reference.clone()),
3288 meta: None,
3289 action: pb::RepairAction::RebuildDependencyIndex as i32,
3290 force: args.force,
3291 view: String::new(),
3292 };
3293 let response = session.repair(request)?;
3294 println!("Repairing change dependency index...");
3295 if args.force {
3296 print_warning("--force enabled: existing dependency index rows will be replaced");
3297 }
3298 print_success(&format!(
3299 "Dependency index repair complete: {} indexed, {} skipped, {} failed",
3300 response.indexed, response.skipped, response.failed
3301 ));
3302 if response.failed > 0 {
3303 print_hint(
3304 "Some changes could not be loaded. Run with verbose logging to identify corrupted or missing change files.",
3305 );
3306 } else if response.indexed > 0 {
3307 print_hint("View filter setup for status/diff/content paths can now use pristine indexes instead of scanning .change files.");
3308 }
3309 Ok(true)
3310}
3311
3312/// `atomic doctor materialize-crdt` over MaintenanceService.Repair.
3313pub fn doctor_materialize_crdt(args: &super::doctor::MaterializeCrdt) -> CliResult<bool> {

Callers 1

runMethod · 0.85

Calls 6

openFunction · 0.85
print_warningFunction · 0.85
print_successFunction · 0.85
print_hintFunction · 0.85
cloneMethod · 0.45
repairMethod · 0.45

Tested by

no test coverage detected