code: def _transform_git_paths_to_dvc(
      repo: "Repo", files: Iterable[str]
  ) -> List[str]:
      """Transform files rel. to Git root to DVC root, and drop outside files."""
      rel = repo.fs.relpath(repo.root_dir, repo.scm.root_dir).rstrip(
          "/"
      )
  
      # if we have repo root in a different location than scm's root,
      # i.e. subdir repo, all git_paths need to be transformed rel. to the DVC
      # repo root and anything outside need to be filtered out.
      if rel not in (os.curdir, ""):
          prefix = rel + os.sep
          length = len(prefix)
          files = (
              file[length:] for file in files if file.startswith(prefix)
          )
  
      start = repo.fs.relpath(repo.fs.getcwd(), repo.root_dir)
      if start in (os.curdir, ""):
          return list(files)
      # we need to convert repo relative paths to curdir relative.
      return [repo.fs.relpath(file, start) for file in files]
  
file_path: dvc/dvc/repo/data.py
imports: import os
  import posixpath
  from typing import TYPE_CHECKING, Any, Dict, Iterable, List, TypedDict, Union
  from dvc.fs.callbacks import DEFAULT_CALLBACK
  from dvc.ui import ui
label_desc: Use image node_id 8 for calling a global function with example usage: _transform_git_paths_to_dvc(repo, files) and returns: unknown, list