mirror of
https://github.com/rojo-rbx/rojo.git
synced 2026-10-23 14:01:37 +00:00
Enhance syncback functionality and improve code readability
- Refactored the syncback process to streamline directory management and improve handling of class transitions in clean mode. - Updated the `clone_tree_filtered` function to accept a tuple of compiled Globs and original pattern strings, enhancing flexibility in ignore pattern handling. - Simplified logic for checking if paths are inside removed directories, improving code clarity. - Added detailed comments to clarify the purpose of new logic for handling script directory transitions, ensuring better maintainability. - Improved logging for better traceability during syncback operations.
This commit is contained in:
parent
1534a54808
commit
411f79ee81
10 changed files with 232 additions and 65 deletions
|
|
@ -126,10 +126,7 @@ impl FsSnapshot {
|
|||
// Also handle the case where the same file might be listed twice (absolute vs relative path)
|
||||
// by gracefully handling "file not found" errors.
|
||||
for path in &self.removed_files {
|
||||
let is_inside_removed_dir = self
|
||||
.removed_dirs
|
||||
.iter()
|
||||
.any(|dir| path.starts_with(dir));
|
||||
let is_inside_removed_dir = self.removed_dirs.iter().any(|dir| path.starts_with(dir));
|
||||
if is_inside_removed_dir {
|
||||
continue;
|
||||
}
|
||||
|
|
@ -158,11 +155,7 @@ impl FsSnapshot {
|
|||
let files_inside_dirs = self
|
||||
.removed_files
|
||||
.iter()
|
||||
.filter(|path| {
|
||||
self.removed_dirs
|
||||
.iter()
|
||||
.any(|dir| path.starts_with(dir))
|
||||
})
|
||||
.filter(|path| self.removed_dirs.iter().any(|dir| path.starts_with(dir)))
|
||||
.count();
|
||||
log::debug!(
|
||||
"Removed {} directories and {} files from the file system ({} files skipped, inside removed dirs)",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue