Skip to content

Commit

Permalink
fs: refactor handleTimestampsAndMode to remove redundant call
Browse files Browse the repository at this point in the history
Refactored the `handleTimestampsAndMode` function to eliminate the
redundant `setDestTimestampsAndMode` call. This simplifies the function
by ensuring that `setDestTimestampsAndMode` is only called once after
any necessary modifications to file writability.

PR-URL: #54369
Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Minwoo Jung <nodecorelab@gmail.com>
  • Loading branch information
rayark1 authored and RafaelGSS committed Aug 25, 2024
1 parent a3f4e56 commit f7b7429
Showing 1 changed file with 0 additions and 1 deletion.
1 change: 0 additions & 1 deletion lib/internal/fs/cp/cp.js
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,6 @@ async function handleTimestampsAndMode(srcMode, src, dest) {
// (through utimes call)
if (fileIsNotWritable(srcMode)) {
await makeFileWritable(dest, srcMode);
return setDestTimestampsAndMode(srcMode, src, dest);
}
return setDestTimestampsAndMode(srcMode, src, dest);
}
Expand Down

0 comments on commit f7b7429

Please sign in to comment.