Not removing prefixes from bundle names anymore

This commit is contained in:
Dennis Schwerdel 2017-06-20 14:19:45 +02:00
parent aad7bb675f
commit 5bb9df761e
2 changed files with 11 additions and 7 deletions

View File

@ -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

View File

@ -86,15 +86,18 @@ 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";
let file = bundle.to_string().to_owned() + ".bundle";
{
let mut rest = &file as &str;
while count >= 100 {
if file.len() < 10 {
if rest.len() < 10 {
break
}
folder = folder.join(&file[0..2]);
file = file[2..].to_string();
folder = folder.join(&rest[0..2]);
rest = &rest[2..];
count /= 250;
}
}
(folder, file.into())
}