@@ -564,27 +564,34 @@ impl DirectoryLayer {
564
564
trx : & Transaction ,
565
565
path : Vec < String > ,
566
566
) -> Result < Vec < String > , DirectoryError > {
567
+ println ! ( "listing path {:?} with self.path={:?}" , & path, & self . path) ;
567
568
self . check_version ( trx, false ) . await ?;
568
569
569
570
let node = self . find ( trx, path. to_owned ( ) ) . await ?;
570
571
if !node. exists ( ) {
571
572
return Err ( DirectoryError :: PathDoesNotExists ) ;
572
573
}
573
- if node. is_in_partition ( false ) {
574
+ if node. is_in_partition ( true ) {
574
575
let subspace_node = match node. subspace {
575
576
// not reachable because `self.find` is creating a node with a subspace.
576
577
None => unreachable ! ( "node's subspace is not set" ) ,
577
578
Some ( ref s) => s. clone ( ) ,
578
579
} ;
579
580
580
- let directory_partition = self . contents_of_node (
581
+ match self . contents_of_node (
581
582
subspace_node,
582
583
node. current_path . to_owned ( ) ,
583
584
node. layer . to_owned ( ) ,
584
- ) ?;
585
- return directory_partition
586
- . list ( trx, node. get_partition_subpath ( ) )
587
- . await ;
585
+ ) ? {
586
+ DirectoryOutput :: DirectorySubspace ( _) => unreachable ! ( "already in partition" ) ,
587
+ DirectoryOutput :: DirectoryPartition ( directory_partition) => {
588
+ return directory_partition
589
+ . directory_subspace
590
+ . directory_layer
591
+ . list ( trx, node. get_partition_subpath ( ) )
592
+ . await
593
+ }
594
+ } ;
588
595
}
589
596
590
597
Ok ( node. list_sub_folders ( trx) . await ?)
0 commit comments