Skip to content

Return RuntimeError when --deduplicate-hardlinks is used with multiple arguments#348

Draft
Copilot wants to merge 2 commits intomasterfrom
copilot/fix-pdu-runtime-error
Draft

Return RuntimeError when --deduplicate-hardlinks is used with multiple arguments#348
Copilot wants to merge 2 commits intomasterfrom
copilot/fix-pdu-runtime-error

Conversation

Copy link
Contributor

Copilot AI commented Mar 10, 2026

Using --deduplicate-hardlinks with multiple path arguments is inherently unreliable across device boundaries and overlapping trees. Rather than attempting to silently fix up the argument list, pdu now rejects this combination outright.

Changes

  • New RuntimeError variant: DeduplicateHardlinkMultipleArgs (exit code 7, #[cfg(unix)]) — emitted when --deduplicate-hardlinks is passed alongside more than one path argument
  • Removed overlapping_arguments module: the path-deduplication logic (remove_overlapping_paths, find_overlapping_paths_to_remove, etc.) is no longer needed and has been deleted entirely
  • App::run() no longer takes mut self: previously required to mutate args.files in-place
  • Updated tests: hardlinks_deduplication_multi_args.rs now asserts the error path instead of the old overlapping-removal behavior
$ pdu --deduplicate-hardlinks dir1 dir2
[error] DeduplicateHardlinkMultipleArgs: --deduplicate-hardlinks cannot be used with multiple arguments

Closes #347


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Co-authored-by: KSXGitHub <11488886+KSXGitHub@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix pdu to return RuntimeError for multiple arguments Return RuntimeError when --deduplicate-hardlinks is used with multiple arguments Mar 11, 2026
@github-actions
Copy link

Performance Regression Reports

commit: 6d86325

There are no regressions.

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.

2 participants