class GitManager {

    public GitTagEntry loadRevision(Pipeline pipeline, String version) throws GitClientException {
        Assert.notNull(version, "Revision is required.");
        if (version.startsWith(DRAFT_PREFIX)) {
            GitCommitEntry repositoryCommit =
                    this.getGitlabClientForPipeline(pipeline).getRepositoryCommit(getRevisionName(version));
            if (repositoryCommit == null) {
                throw new IllegalArgumentException(String.format("Commit %s not found.", version));
            }
            return new GitTagEntry(repositoryCommit);
        } else {
            GitTagEntry revision = this.getGitlabClientForPipeline(pipeline).getRepositoryRevision(version);
            if (revision == null) {
                throw new IllegalArgumentException(
                        String.format("Revision %s not found.", version));
            }
            return revision;
        }
    }

}