import shutil
from pathlib import Path


def has_git() -> bool:
  """
  Return True if we are in a Git repository and have Git.
  """

  # return False if we don't have Git
  if shutil.which("git") is None:
    return False

  # return False if we have no Git repository information
  if not (Path(__file__).parent / "../../.git").exists():
    return False

  return True