fix: Fixed an issue where the list_objects_v2 API did not return dire… (#352)

* fix: Fixed an issue where the list_objects_v2 API did not return directory names when they conflicted with file names in the same bucket (e.g., test/ vs. test.txt, aaa/ vs. aaa.csv) (#335)

* fix: adjusted the order of directory listings
This commit is contained in:
shiro.lee
2025-08-07 11:05:05 +08:00
committed by GitHub
parent fd539f0f0a
commit c42fbed3d2

View File

@@ -953,9 +953,8 @@ impl LocalDisk {
let name = path_join_buf(&[current, entry]);
if !dir_stack.is_empty() {
if let Some(pop) = dir_stack.pop() {
if let Some(pop) = dir_stack.last().cloned() {
if pop < name {
//
out.write_obj(&MetaCacheEntry {
name: pop.clone(),
..Default::default()
@@ -969,6 +968,7 @@ impl LocalDisk {
error!("scan_dir err {:?}", er);
}
}
dir_stack.pop();
}
}
}