Browse Source

Not removing prefixes from bundle names anymore

pull/10/head
Dennis Schwerdel 5 years ago
parent
commit
5bb9df761e
  1. 1
      CHANGELOG.md
  2. 17
      src/repository/layout.rs

1
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

17
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())
}

Loading…
Cancel
Save