Commit a9f8fdf
committed
Fix LocalFileSystem.move() to not follow symlinks when checking source existence
The move() method was using exists(sourcePath) which follows symlinks by default.
This caused failures when moving a symlink whose target had already been moved,
because it would try to follow the symlink to validate the target exists.
Now uses exists(sourcePath, followSymlink: false) to check if the symlink itself
exists, allowing symlinks to be moved even if their targets have been relocated.
This fixes an issue where extracting package archives with symlinks could fail
if files were moved in alphabetical order and a target file was moved before
its symlink.
Added test testMoveSymlinkWithMovedTarget() to verify this behavior.1 parent b157c62 commit a9f8fdf
File tree
2 files changed
+42
-1
lines changed- Sources/TSCBasic
- Tests/TSCBasicTests
2 files changed
+42
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
735 | 735 | | |
736 | 736 | | |
737 | 737 | | |
738 | | - | |
| 738 | + | |
739 | 739 | | |
740 | 740 | | |
741 | 741 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
511 | 511 | | |
512 | 512 | | |
513 | 513 | | |
| 514 | + | |
| 515 | + | |
| 516 | + | |
| 517 | + | |
| 518 | + | |
| 519 | + | |
| 520 | + | |
| 521 | + | |
| 522 | + | |
| 523 | + | |
| 524 | + | |
| 525 | + | |
| 526 | + | |
| 527 | + | |
| 528 | + | |
| 529 | + | |
| 530 | + | |
| 531 | + | |
| 532 | + | |
| 533 | + | |
| 534 | + | |
| 535 | + | |
| 536 | + | |
| 537 | + | |
| 538 | + | |
| 539 | + | |
| 540 | + | |
| 541 | + | |
| 542 | + | |
| 543 | + | |
| 544 | + | |
| 545 | + | |
| 546 | + | |
| 547 | + | |
| 548 | + | |
| 549 | + | |
| 550 | + | |
| 551 | + | |
| 552 | + | |
| 553 | + | |
| 554 | + | |
514 | 555 | | |
515 | 556 | | |
516 | 557 | | |
| |||
0 commit comments