mirror of https://github.com/dswd/zvault
Not removing prefixes from bundle names anymore
This commit is contained in:
parent
aad7bb675f
commit
5bb9df761e
|
@ -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
|
||||
|
||||
|
||||
|
|
|
@ -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())
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue