Commit 71c36b8
committed
fix(config[_atomic_write]) resolve symlinks before atomic rename
why: `Path.replace()` operates on directory entries, not file contents.
When the target is a symlink, the symlink itself gets replaced by the
temp file — the real target file is left stale. This breaks dotfile
setups where `~/.vcspull.yaml` symlinks to a managed location.
what:
- Resolve target path before creating temp file and renaming
- Temp file now created next to the real destination (also fixes
latent cross-device rename when symlink spans filesystems)1 parent a27924c commit 71c36b8
1 file changed
Lines changed: 14 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
668 | 668 | | |
669 | 669 | | |
670 | 670 | | |
| 671 | + | |
| 672 | + | |
| 673 | + | |
| 674 | + | |
671 | 675 | | |
672 | 676 | | |
673 | 677 | | |
674 | | - | |
| 678 | + | |
675 | 679 | | |
676 | 680 | | |
677 | 681 | | |
| 682 | + | |
| 683 | + | |
| 684 | + | |
| 685 | + | |
678 | 686 | | |
679 | | - | |
680 | | - | |
| 687 | + | |
| 688 | + | |
681 | 689 | | |
682 | 690 | | |
683 | | - | |
684 | | - | |
| 691 | + | |
| 692 | + | |
685 | 693 | | |
686 | 694 | | |
687 | 695 | | |
688 | 696 | | |
689 | 697 | | |
690 | 698 | | |
691 | 699 | | |
692 | | - | |
| 700 | + | |
693 | 701 | | |
694 | 702 | | |
695 | 703 | | |
| |||
0 commit comments