code: def is_git_directory(path='.'):
      
      try:
          dulwich.repo.Repo.discover(path)
      except dulwich.errors.NotGitRepository:
          return False
  
      return True
docs: Checks if given directory is a git repository
      :param path: path to check
      :return: True if it's a git repo and False otherwise