fix: handle symlinks in WriteFileAtomic#307
Conversation
65fcd71 to
c9984a8
Compare
|
I also use Stow to sync my dotfiles, and this error is a real headache. Thanks for the PR, and I hope it gets reviewed soon. |
Alan-TheGentleman
left a comment
There was a problem hiding this comment.
This is a useful filesystem bugfix, but it needs the standard contribution gates before review.
Please add the required type:bug label, confirm the approved issue link, and refresh CI against current main.
|
Thanks for the contribution. I’m closing this PR because it does not link to an issue with Please follow the project process:
This keeps review scope clear and prevents CI/process failures. |
|
Hey, thanks for contributing! Per CONTRIBUTING.md, every PR needs an issue linked with Closing for now. To pick the work back up:
Sorry for the friction — the gate is automated, there's no workaround. Come back when it's ready! |
Linked Issue
Closes #306
PR Type
Summary
Was hitting errors when writing to symlinked config files, which breaks dotfile managers like stow and chezmoi. The issue was WriteFileAtomic was treating symlinks as regular files and potentially replacing them instead of updating the target.
Added symlink resolution so we write to the actual file and preserve the symlink.
Changes
Test Plan
Added TestWriteFileAtomic_PreservesSymlink which creates a symlink, writes through it, and verifies the target file is updated while the symlink stays intact. Existing tests pass.