Migrate cp/mv relocation dry-run to renderOperation#353
Merged
Conversation
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).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fifth PR in the dry-run generalization series. Routes the shared cp/mv relocation driver's dry-run branch through the
renderOperationhelper (#350), dropping the duplicatedcommandOutput(cmd).Render(..., newJSONCommandOperationOutput(cmd, ...))glue.Changes
cmd/relocation.go— dry-run branch usesrenderOperation.One edit covers both cp and mv, since they share this driver. The
renderPlannedRelocationResultsclosure (multi-result "Would move/copy X to Y" text) moves intorenderOperationunchanged.Behavior
Unchanged. Verified byte-for-byte against a pre-refactor baseline binary on a live account:
cp --dry-run --output json— identical (status:"planned",dry_run:true, full metadata)mv --dry-runtext — identicalmv --dry-runinto a folder — both entries planned