Skip to content

Migrate cp/mv relocation dry-run to renderOperation#353

Merged
AndreyVMarkelov merged 2 commits into
masterfrom
feature/dry-run-relocation
Jul 10, 2026
Merged

Migrate cp/mv relocation dry-run to renderOperation#353
AndreyVMarkelov merged 2 commits into
masterfrom
feature/dry-run-relocation

Conversation

@AndreyVMarkelov

@AndreyVMarkelov AndreyVMarkelov commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

Summary

Fifth PR in the dry-run generalization series. Routes the shared cp/mv relocation driver's dry-run branch through the renderOperation helper (#350), dropping the duplicated commandOutput(cmd).Render(..., newJSONCommandOperationOutput(cmd, ...)) glue.

Changes

  • cmd/relocation.go — dry-run branch uses renderOperation.

One edit covers both cp and mv, since they share this driver. The renderPlannedRelocationResults closure (multi-result "Would move/copy X to Y" text) moves into renderOperation unchanged.

Behavior

Unchanged. Verified byte-for-byte against a pre-refactor baseline binary on a live account:

  • cp --dry-run --output jsonidentical (status:"planned", dry_run:true, full metadata)
  • mv --dry-run text — identical
  • multi-source mv --dry-run into a folder — both entries planned
  • nonexistent source — clean error, exit 1, no partial output
  • source tree confirmed untouched (dry-run performs its GetMetadata lookups but creates nothing)

AndreyVMarkelov and others added 2 commits July 9, 2026 22:34
Migrate rm and share-link revoke 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).
@AndreyVMarkelov AndreyVMarkelov merged commit 4201d38 into master Jul 10, 2026
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant