@SuppressWarnings("java:S2095")
    public GitRepository build() {
        try {
            val transportCallback = buildTransportConfigCallback();
            val providers = credentialsProviders.toArray(CredentialsProvider[]::new);
            if (repositoryDirectory.exists()) {
                LOGGER.debug("Using existing repository at [{}]", repositoryDirectory);
                return getExistingGitRepository(transportCallback);
            }
            return cloneGitRepository(transportCallback, providers);
        } catch (final Exception e) {
            LoggingUtils.error(LOGGER, e);
            throw new IllegalArgumentException(e.getMessage(), e);
        }
    }
Build git repository.

@return the git repository
support/cas-server-support-git-core/src/main/java/org/apereo/cas/git/GitRepositoryBuilder.java