diff --git a/CHANGELOG.md b/CHANGELOG.md index 15ca615..77401c2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,7 @@ This project follows [semantic versioning](http://semver.org). * [modified] Also documenting common flags in subcommands * [modified] Using repository aliases (**conversion needed**) * [modified] Remote path must be absolute +* [modified] Not removing prefixes from bundle names anymore * [fixed] Fixed tarfile import diff --git a/src/repository/layout.rs b/src/repository/layout.rs index 0d3f421..8282a99 100644 --- a/src/repository/layout.rs +++ b/src/repository/layout.rs @@ -86,14 +86,17 @@ impl RepositoryLayout { } fn bundle_path(&self, bundle: &BundleId, mut folder: PathBuf, mut count: usize) -> (PathBuf, PathBuf) { - let mut file = bundle.to_string().to_owned() + ".bundle"; - while count >= 100 { - if file.len() < 10 { - break + let file = bundle.to_string().to_owned() + ".bundle"; + { + let mut rest = &file as &str; + while count >= 100 { + if rest.len() < 10 { + break + } + folder = folder.join(&rest[0..2]); + rest = &rest[2..]; + count /= 250; } - folder = folder.join(&file[0..2]); - file = file[2..].to_string(); - count /= 250; } (folder, file.into()) }