@@ -1388,7 +1388,7 @@ class NamespaceFS {
13881388 dbg . log1 ( 'NamespaceFS._finish_upload:' , open_mode , file_path , upload_path , fs_xattr ) ;
13891389
13901390 if ( ! same_inode && ! part_upload ) {
1391- await this . _move_to_dest ( fs_context , upload_path , file_path , target_file , open_mode , params . key ) ;
1391+ await this . _move_to_dest ( fs_context , upload_path , file_path , target_file , open_mode , params . key , is_dir_content ) ;
13921392 }
13931393
13941394 // when object is a dir, xattr are set on the folder itself and the content is in .folder file
@@ -1421,13 +1421,16 @@ class NamespaceFS {
14211421 }
14221422
14231423 // move to dest GPFS (wt) / POSIX (w / undefined) - non part upload
1424- async _move_to_dest ( fs_context , source_path , dest_path , target_file , open_mode , key ) {
1424+ async _move_to_dest ( fs_context , source_path , dest_path , target_file , open_mode , key , is_dir_content ) {
1425+ dbg . log2 ( '_move_to_dest' , fs_context , source_path , dest_path , target_file , open_mode , key , is_dir_content ) ;
14251426 let retries = config . NSFS_RENAME_RETRIES ;
14261427 // will retry renaming a file in case of parallel deleting of the destination path
14271428 for ( ; ; ) {
14281429 try {
14291430 await native_fs_utils . _make_path_dirs ( dest_path , fs_context ) ;
1430- if ( this . _is_versioning_disabled ( ) ) {
1431+ if ( this . _is_versioning_disabled ( ) ||
1432+ ( this . _is_versioning_enabled ( ) && is_dir_content ) ) {
1433+ // dir_content is not supported in versioning, hence we will treat it like versioning disabled
14311434 if ( open_mode === 'wt' ) {
14321435 await target_file . linkfileat ( fs_context , dest_path ) ;
14331436 } else {
0 commit comments