Implement encoding and decoding for Windows-invalid characters in file names

- Added `encode_path_name` and `decode_path_name` functions to handle encoding and decoding of invalid characters.
- Updated `SyncbackRules` to include an option for encoding Windows-invalid characters during syncback.
- Modified `name_for_inst` to conditionally encode invalid characters based on the new option.
- Adjusted `ServeSession` and `InstanceContext` to support the new encoding feature.
- Updated tests and snapshots to reflect changes in encoding behavior.
This commit is contained in:
Joe 2025-12-19 22:50:53 -06:00
parent db87fa010f
commit 6d8c85682d
59 changed files with 350 additions and 53 deletions

View file

@ -172,6 +172,11 @@ pub fn syncback_dir_no_meta<'sync>(
);
continue;
}
// Skip instances matching ignoreTrees
if snapshot.should_ignore_tree(*new_child_ref) {
old_child_map.remove(new_child.name.as_str());
continue;
}
if let Some(old_child) = old_child_map.remove(new_child.name.as_str()) {
if old_child.metadata().relevant_paths.is_empty() {
log::debug!(
@ -223,6 +228,10 @@ pub fn syncback_dir_no_meta<'sync>(
);
continue;
}
// Skip instances matching ignoreTrees
if snapshot.should_ignore_tree(*new_child_ref) {
continue;
}
children.push(snapshot.with_joined_path(*new_child_ref, None)?);
}
}