Repository navigation
Conversation
semimikoh
force-pushed
the
fix-fs-cp-dangling-symlink
branch
2 times, most recently
from
October 23, 2026 09:42
c3cd1c5 to
0b4bc15
Compare
Reuse srcIsDir instead of stat() for the subdirectory check. Signed-off-by: semimikoh <ejffjeosms@gmail.com>
semimikoh
force-pushed
the
fix-fs-cp-dangling-symlink
branch
from
October 23, 2026 09:52
0b4bc15 to
e5b7ba7
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #66948 +/- ##
==========================================
- Coverage 90.60% 90.59% -0.02%
==========================================
Files 797 797
Lines 278276 278325 +49
Branches 53498 53516 +18
==========================================
+ Hits 252133 252139 +6
- Misses 16506 16562 +56
+ Partials 9637 9624 -13
🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Use the existing source directory check instead of stat()ing the link target.
fs.cp()fails withENOENTwhen a dangling source symlink replaces an existing symlink. This uses the already computedsrcIsDirfor the subdirectory check instead of callingstat(src), and adds a regression test.The new regression test and the existing symlink protection test pass. The full test suite is still running.
Fixes: #66946