code: def _git_info(
      scm: Union["Git", "NoSCM"], untracked_files: str = "all"
  ) -> GitInfo:
      from scmrepo.exceptions import SCMError
  
      from dvc.scm import NoSCM
  
      if isinstance(scm, NoSCM):
          return {}
  
      try:
          scm.get_rev()
      except SCMError:
          empty_repo = True
      else:
          empty_repo = False
  
      staged, unstaged, untracked = scm.status(
          untracked_files=untracked_files
      )
      if os.name == "nt":
          untracked = [posixpath_to_os_path(path) for path in untracked]
      # NOTE: order is important here.
      return GitInfo(
          staged=staged,
          unstaged=unstaged,
          untracked=untracked,
          is_empty=empty_repo,
          is_dirty=any([staged, unstaged, untracked]),
      )
  
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 5 for calling a global function with example usage: _git_info(scm, untracked_files) and returns: GitInfo, dict