Skip to content

Commit b2e8bc9

Browse files
committed
Apply review cleanups to the remove/repair sweep
The hosted-only path records its events directly with the hosted mode instead of collecting and tagging them, and stops cloning the leg's warnings. Repair's hosted-only print says why it adds a period. Assisted-by: Claude Code:claude-opus-5-5
1 parent 9d0b1f0 commit b2e8bc9

2 files changed

Lines changed: 7 additions & 12 deletions

File tree

‎crates/socket-patch-cli/src/commands/remove.rs‎

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1621,7 +1621,7 @@ async fn remove_hosted_only(
16211621
};
16221622
let mut env = Envelope::new(Command::Remove);
16231623
env.dry_run = args.common.dry_run;
1624-
let mut warnings = leg.warnings.clone();
1624+
let mut warnings = leg.warnings;
16251625
if args.preserve_state && !leg.reverted.is_empty() {
16261626
warnings.push(note_hosted_state_not_preservable(&args.common));
16271627
}
@@ -1630,17 +1630,11 @@ async fn remove_hosted_only(
16301630
.push(crate::json_envelope::RunWarning::new(code, detail));
16311631
}
16321632
// Human per-purl lines already printed inside `run_hosted_leg`.
1633-
let mut events: Vec<PatchEvent> = leg
1634-
.reverted
1635-
.iter()
1636-
.map(|purl| hosted_reverted_event(args.common.dry_run, purl))
1637-
.collect();
1638-
crate::commands::vendored_backend::tag_event_mode(
1639-
&mut events,
1640-
crate::commands::HOSTED_MODE_LABEL,
1641-
);
1642-
for ev in events {
1643-
env.record(ev);
1633+
for purl in &leg.reverted {
1634+
env.record(
1635+
hosted_reverted_event(args.common.dry_run, purl)
1636+
.with_details(serde_json::json!({ "mode": crate::commands::HOSTED_MODE_LABEL })),
1637+
);
16441638
}
16451639
if args.common.json {
16461640
crate::ui::print_json(&env.to_value());

‎crates/socket-patch-cli/src/commands/repair.rs‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,7 @@ pub async fn run(args: RepairArgs) -> i32 {
124124
);
125125
crate::ui::print_json(&env.to_value());
126126
} else if !args.common.silent {
127+
// The JSON reason keeps its period-less text.
127128
println!("{msg}.");
128129
}
129130
return 0;

0 commit comments

Comments
 (0)