code: def get_uncommitted_changes(
      repo: Optional["git.Repo"],
  ) -> Optional[UncommittedChanges]:
      head_index_diff = get_diff(repo, repo.head.name)
  
      upstream_sha = get_upstream_index_sha(repo)
  
      upstream_index_diff = (
          get_diff(repo, upstream_sha) if upstream_sha else None
      )
      if head_index_diff or upstream_sha or upstream_index_diff:
          return UncommittedChanges(
              head_index_diff, upstream_index_diff, upstream_sha
          )
  
file_path: neptune-client/src/neptune/internal/utils/git.py
imports: import logging
  import warnings
  from dataclasses import dataclass
  from datetime import datetime
  from typing import TYPE_CHECKING, List, Optional, Union
  from neptune.attributes.constants import DIFF_HEAD_INDEX_PATH, UPSTREAM_INDEX_DIFF
  from neptune.types import File
  from neptune.types.atoms.git_ref import GitRef, GitRefDisabled
label_desc: Use image node_id 8 for calling a global function with example usage: get_uncommitted_changes(repo) and returns: UncommittedChanges