def METHOD_NAME(self) -> str:
    remote_sha1_commit = Git().ls_remote(self.url, self.branch).split("\t")[0]
    local_sha1_commit = Repo(self.clone_directory).head.object.hexsha
    if remote_sha1_commit != local_sha1_commit:
        logging.info(
            "Remote sha is '%s' while local sha is '%s': pulling new commits",
            remote_sha1_commit,
            local_sha1_commit,
        )
        try:
            repo = Repo(self.clone_directory)
            if repo.is_dirty():
                raise DirtyPrimerDirectoryException(self.clone_directory)
            origin = repo.remotes.origin
            origin.pull()
        except GitCommandError as e:
            raise SystemError(
                f"Failed to clone repository for {self.clone_directory}"
            ) from e
    else:
        logging.info("Repository already up to date.")
    return str(remote_sha1_commit)