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

    return True