From 49258fec5b6f596a8b8b2ee953fad5b111e4af1e Mon Sep 17 00:00:00 2001 From: Andrey Markelov Date: Thu, 9 Jul 2026 22:34:20 -0700 Subject: [PATCH] Migrate cp/mv relocation dry-run to renderOperation Route the shared relocation driver's dry-run branch through renderOperation, dropping the duplicated commandOutput/newJSONCommandOperationOutput glue. One edit covers both cp and mv since they share the driver; the renderPlannedRelocationResults closure moves in unchanged. Output is unchanged, verified byte-for-byte against the pre-refactor binary for cp dry-run JSON and mv dry-run text on a live account, with the source tree confirmed untouched (dry-run performs its GetMetadata lookups but creates nothing). --- cmd/relocation.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cmd/relocation.go b/cmd/relocation.go index dd954b1..8573817 100644 --- a/cmd/relocation.go +++ b/cmd/relocation.go @@ -156,9 +156,9 @@ func runRelocation(cmd *cobra.Command, args []string, spec relocationSpec) error } if opts.dryRun { - return commandOutput(cmd).Render(func(w io.Writer) error { + return renderOperation(cmd, nil, results, nil, func(w io.Writer) error { return renderPlannedRelocationResults(w, spec.verb, plannedResults) - }, newJSONCommandOperationOutput(cmd, nil, results, nil)) + }) } if !collectResults {