@@ -564,27 +564,34 @@ impl DirectoryLayer {
564564 trx : & Transaction ,
565565 path : Vec < String > ,
566566 ) -> Result < Vec < String > , DirectoryError > {
567+ println ! ( "listing path {:?} with self.path={:?}" , & path, & self . path) ;
567568 self . check_version ( trx, false ) . await ?;
568569
569570 let node = self . find ( trx, path. to_owned ( ) ) . await ?;
570571 if !node. exists ( ) {
571572 return Err ( DirectoryError :: PathDoesNotExists ) ;
572573 }
573- if node. is_in_partition ( false ) {
574+ if node. is_in_partition ( true ) {
574575 let subspace_node = match node. subspace {
575576 // not reachable because `self.find` is creating a node with a subspace.
576577 None => unreachable ! ( "node's subspace is not set" ) ,
577578 Some ( ref s) => s. clone ( ) ,
578579 } ;
579580
580- let directory_partition = self . contents_of_node (
581+ match self . contents_of_node (
581582 subspace_node,
582583 node. current_path . to_owned ( ) ,
583584 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+ } ;
588595 }
589596
590597 Ok ( node. list_sub_folders ( trx) . await ?)
0 commit comments