code: def _update_out_meta(
      repo: "Repo",
      out: "Output",
      local_index: Union["DataIndex", "DataIndexView"],
      remote_index: Union["DataIndex", "DataIndexView"],
      remote: "Remote",
  ):
      from dvc_data.index.save import build_tree
  
      index = _get_update_diff_index(
          repo, out, local_index, remote_index, remote
      )
  
      _, key = out.index_key
      entry = index[key]
      if out.isdir():
          tree_meta, new_tree = build_tree(index, key)
          out.obj = new_tree
          out.hash_info = new_tree.hash_info
          out.meta = tree_meta
      else:
          if entry.hash_info:
              out.hash_info = entry.hash_info
          out.meta = entry.meta
      if out.meta:
          out.meta.remote = remote.name
  
file_path: dvc/dvc/repo/worktree.py
imports: from functools import partial
  from typing import TYPE_CHECKING, Any, Dict, Iterable, Optional, Tuple, Union
  from funcy import first
  from dvc.log import logger
  from dvc.stage.exceptions import StageUpdateError
label_desc: Use image node_id 10 for calling a global function with example usage: _update_out_meta(repo, out, local_index, remote_index, remote) without return types