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] Also documenting common flags in subcommands
|
||||||
* [modified] Using repository aliases (**conversion needed**)
|
* [modified] Using repository aliases (**conversion needed**)
|
||||||
* [modified] Remote path must be absolute
|
* [modified] Remote path must be absolute
|
||||||
|
* [modified] Not removing prefixes from bundle names anymore
|
||||||
* [fixed] Fixed tarfile import
|
* [fixed] Fixed tarfile import
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -86,14 +86,17 @@ impl RepositoryLayout {
|
||||||
}
|
}
|
||||||
|
|
||||||
fn bundle_path(&self, bundle: &BundleId, mut folder: PathBuf, mut count: usize) -> (PathBuf, PathBuf) {
|
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";
|
||||||
while count >= 100 {
|
{
|
||||||
if file.len() < 10 {
|
let mut rest = &file as &str;
|
||||||
break
|
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())
|
(folder, file.into())
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue