Get the SHA1 of the current repo

def get_repo_hexsha(git_folder):
    """Get the SHA1 of the current repo"""
    repo = Repo(str(git_folder))
    if repo.bare:
        not_git_hexsha = "notgitrepo"
        _LOGGER.warning("Not a git repo, SHA1 used will be: %s", not_git_hexsha)
        return not_git_hexsha
    hexsha = repo.head.commit.hexsha
    _LOGGER.info("Found REST API repo SHA1: %s", hexsha)
    return hexsha