Skip to content

fix: prevent destructive overwrite of decompression directories - #1044

Open
fzlzjerry wants to merge 1 commit into
ouch-org:mainfrom
fzlzjerry:fix/decompress-directory-overwrite
Open

fix: prevent destructive overwrite of decompression directories#1044
fzlzjerry wants to merge 1 commit into
ouch-org:mainfrom
fzlzjerry:fix/decompress-directory-overwrite

Conversation

@fzlzjerry

Copy link
Copy Markdown

Closes #1043.

Summary

  • remove the destructive overwrite choice when a decompression conflict target is a directory
  • keep rename, merge, and skip for directory conflicts while preserving overwrite for actual file conflicts
  • update the multi-format merge coverage and add regressions for preserving unrelated directory contents and overwriting a single-file target
  • document the fix in the changelog

Validation

  • cargo test --locked
  • cargo test --locked --no-default-features
  • cargo test --locked --no-default-features --features unrar,use_zlib,use_zstd_thin
  • cargo clippy --locked --all-targets -- -D warnings
  • cargo clippy --locked --no-default-features --all-targets -- -D warnings
  • cargo +nightly fmt -- --check

@fzlzjerry
fzlzjerry marked this pull request as ready for review August 11, 2026 08:57
Copilot AI lite review requested due to automatic review settings August 11, 2026 08:57

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@marcospb19

Copy link
Copy Markdown
Member

review requested due to automatic review settings

wat, uh, oke, Imma ignore that

@marcospb19

Copy link
Copy Markdown
Member

remove the destructive overwrite choice when a decompression conflict target is a directory

Did you choose that by accident and had an unintended deletion? Do you think the conflict message was confusing and could be improved?

@fzlzjerry

Copy link
Copy Markdown
Author

No, I did not lose data myself; I reproduced the behavior reported in #1043. The prompt says overwrite, but for an explicit --dir it does not make clear that this recursively removes the entire existing destination, including unrelated contents. The reporter expected archive collisions to be overwritten and lost unrelated projects, which is why I removed the directory-level option. If you prefer to keep it, I can narrow the patch to an explicit destructive warning/confirmation instead.

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.

Bug: Decompressing with --dir flag and choosing 'overwrite' wipes parent directory contents

3 participants