Skip to content

mv: avoid overwriting just-created destinations - #746

Merged
ewhauser merged 1 commit into
mainfrom
ewhauser/mv-childproof-guard
Mar 27, 2026
Merged

ewhauser merged 1 commit into
mainfrom
ewhauser/mv-childproof-guard

Conversation

@ewhauser

Copy link
Copy Markdown
Owner

Summary

  • track non-directory destinations created earlier in the same mv invocation
  • refuse to overwrite a just-created destination later in the same command unless --backup=numbered is active
  • add focused regressions for the basic childproof case, the numbered-backup exception, and the fuller GNU mv childproof sequence

Testing

  • go test ./internal/builtins -run "^TestMV"

Notes

  • The shared GNU tests/mv/childproof.sh script still fails overall because it also exercises cp and ln; the new mv-only regressions cover the mv behavior in this PR.

@ewhauser
ewhauser merged commit 8719e6f into main Mar 27, 2026
15 checks passed
@ewhauser
ewhauser deleted the ewhauser/mv-childproof-guard branch March 27, 2026 02:13
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