anchor.diff:  
       case SourceSpaceId =:= TargetSpaceId of
           true ->
  -            rename_trivial(CTX, SourceEntry, LogicalTargetPath);
  +            case FileType of
  +                ?REGULAR_FILE_TYPE ->
  +                    rename_file_trivial(CTX, SourceEntry, LogicalTargetPath);
  +                ?DIRECTORY_TYPE ->
  +                    rename_dir_trivial(CTX, SourceEntry, LogicalTargetPath)
  +            end;
           false ->
               #fslogic_ctx{session_id = SessId, session = #session{}} = CTX,
               {ok, #auth{macaroon = Macaroon, disch_macaroons = DMacaroons}} =
  
positive.code: %%--------------------------------------------------------------------
  -spec rename_select(CTX :: fslogic_worker:ctx(), SourceEntry :: fslogic_worker:file(),
      CanonicalTargetPath :: file_meta:path(),
      LogicalTargetPath :: file_meta:path()) ->
      ok | logical_file_manager:error_reply().
  rename_select(CTX, SourceEntry, CanonicalTargetPath, LogicalTargetPath) ->
      {_, TargetParentPath} = fslogic_path:basename_and_parent(CanonicalTargetPath),
      {ok, #document{key = SourceUUID}} = file_meta:get(SourceEntry),
      SourceSpaceId = fslogic_spaces:get_space_id(SourceUUID),
  
negative.code: 
              case Doc of
                  #document{value = #file_meta{type = ?REGULAR_FILE_TYPE}} ->
                      {ok, TargetGuid} = logical_file_manager:create(SessId, NewPath, 8#777),
                      ok = copy_file_contents(SessId, {guid, SourceGuid}, {guid, TargetGuid});
  
                  #document{value = #file_meta{type = ?DIRECTORY_TYPE}} ->
                      {ok, TargetGuid} = logical_file_manager:mkdir(SessId, NewPath, 8#777)
              end,
              {guid, TargetGuid}
          end,
          fun(#document{key = SourceUuid, value = #file_meta{atime = ATime,
              mtime = MTime, ctime = CTime, mode = Mode}} = Doc, Target) ->
              SourceGuid = fslogic_uuid:to_file_guid(SourceUuid),
              ok = logical_file_manager:set_perms(SessId, Target, Mode),
              ok = logical_file_manager:update_times(SessId, Target, ATime, MTime, CTime),
              ok = copy_file_attributes(SessId, {guid, SourceGuid}, Target),
              case Doc of
                  #document{value = #file_meta{type = ?REGULAR_FILE_TYPE}} ->
                      ok = logical_file_manager:unlink(SessId, {guid, SourceGuid});
  
                  #document{value = #file_meta{type = ?DIRECTORY_TYPE}} ->
                      ok = logical_file_manager:rmdir(SessId, {guid, SourceGuid})
              end
          end),
  
      CurrTime = erlang:system_time(seconds),
  