ZIm/crates/fs/src
张小白 1f257f4704
fs: Fix copy_recursive (#25317)
Closes #24746

This PR modifies the implementation of `copy_recursive`. Previously, we
were copying and pasting simultaneously, which caused an issue when a
user copied a folder into one of its subfolders. This resulted in new
content being created in the folder while copying, and subsequent
recursive calls to `copy_recursive` would continue this process, leading
to an infinite loop.

In this PR, the approach has been changed: we now first collect the
paths of the files to be copied, and only then perform the copy
operation.

Additionally, I have added corresponding tests. On the main branch, this
test would previously run indefinitely.

Release Notes:

- Fixed `copy_recursive` runs infinitely when copying a folder into its
subfolder.
2025-02-24 11:02:14 +02:00
..
fs.rs fs: Fix copy_recursive (#25317) 2025-02-24 11:02:14 +02:00
fs_watcher.rs windows: Fix FS-related issues (#23369) 2025-01-21 14:19:23 +08:00
mac_watcher.rs git: Add support for opening git worktrees (#20164) 2024-11-06 09:43:39 +01:00