mirror of
https://github.com/rojo-rbx/rojo.git
synced 2026-10-23 05:51:39 +00:00
Enhance slug deduplication and metadata handling in syncback process
- Introduced a new method `dedup_against_dir` to deduplicate slugified names against existing entries in a parent directory, improving collision handling during file operations. - Updated the `syncback_added_instance` method to utilize sibling slug sets, ensuring new instances do not overwrite existing files or directories. - Refactored `strip_middleware_extension` to be publicly accessible for broader use in deduplication logic. - Improved comments and code organization for better clarity in the slugification and deduplication processes.
This commit is contained in:
parent
f38c1f1311
commit
7d47fe73f6
4 changed files with 238 additions and 53 deletions
|
|
@ -85,8 +85,9 @@ pub fn name_for_inst<'a>(
|
|||
}
|
||||
|
||||
/// Strips the middleware extension from a filename to recover the bare slug.
|
||||
/// Used internally by `name_for_inst` to derive the dedup key for old instances.
|
||||
fn strip_middleware_extension(filename: &str, middleware: Middleware) -> String {
|
||||
/// Used by `name_for_inst` to derive the dedup key for old instances, and by
|
||||
/// callers that need to seed `taken_names` from filesystem paths.
|
||||
pub fn strip_middleware_extension(filename: &str, middleware: Middleware) -> String {
|
||||
// Dir middleware has no extension — filename IS the slug
|
||||
match middleware {
|
||||
Middleware::Dir
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue