Skip to content

fs: fix repeated copies of directory symlinks - #65099

Open
Archkon wants to merge 1 commit into
nodejs:mainfrom
Archkon:fs
Open

fs: fix repeated copies of directory symlinks#65099
Archkon wants to merge 1 commit into
nodejs:mainfrom
Archkon:fs

Conversation

@Archkon

@Archkon Archkon commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

Fixes: #65097

@nodejs-github-bot nodejs-github-bot added c++ Issues and PRs that require attention from people who are familiar with C++. fs Issues and PRs related to the fs subsystem / file system. needs-ci PRs that need a full CI run. labels Aug 7, 2026
@codecov

codecov Bot commented Aug 7, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 90.30%. Comparing base (985aa07) to head (3c820e0).
⚠️ Report is 3 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #65099      +/-   ##
==========================================
- Coverage   90.31%   90.30%   -0.01%     
==========================================
  Files         759      759              
  Lines      248299   248300       +1     
  Branches    46854    46859       +5     
==========================================
- Hits       224251   224238      -13     
- Misses      15468    15483      +15     
+ Partials     8580     8579       -1     
Files with missing lines Coverage Δ
lib/internal/fs/cp/cp.js 86.61% <100.00%> (-1.74%) ⬇️
src/node_file.cc 74.11% <100.00%> (-0.12%) ⬇️

... and 31 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Treat a destination as a subdirectory only when it has more path
components than the source. This prevents fs.cp() and fs.cpSync()
from rejecting symlinks with identical targets as self-copies.

Signed-off-by: Archkon <180910180+Archkon@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

c++ Issues and PRs that require attention from people who are familiar with C++. fs Issues and PRs related to the fs subsystem / file system. needs-ci PRs that need a full CI run.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fs.cp and fs.cpSync fail to repeatedly copy directory with symlinks

2 participants