mirror of
https://github.com/qwjyh/xdbm
synced 2025-04-20 03:35:55 +09:00
fix: apply subpath logic patch to util::min_parent_storage
This commit is contained in:
parent
ced354bf58
commit
6a0abd03d5
1 changed files with 4 additions and 1 deletions
|
@ -21,7 +21,10 @@ pub fn min_parent_storage<'a>(
|
||||||
.filter_map(|(k, storage)| {
|
.filter_map(|(k, storage)| {
|
||||||
let storage_path = storage.mount_path(device)?;
|
let storage_path = storage.mount_path(device)?;
|
||||||
let diff = pathdiff::diff_paths(path, storage_path)?;
|
let diff = pathdiff::diff_paths(path, storage_path)?;
|
||||||
if diff.components().any(|c| c == path::Component::ParentDir) {
|
if diff
|
||||||
|
.components()
|
||||||
|
.any(|c| matches!(c, path::Component::ParentDir | path::Component::Prefix(_)))
|
||||||
|
{
|
||||||
None
|
None
|
||||||
} else {
|
} else {
|
||||||
Some((k, diff))
|
Some((k, diff))
|
||||||
|
|
Loading…
Add table
Reference in a new issue