@Override
    public GitRepository.GitObject readObject(final TreeWalk treeWalk) throws Exception {
        try (val out = new ByteArrayOutputStream()) {
            val objectId = treeWalk.getObjectId(0);
            val repository = gitInstance.getRepository();
            val loader = repository.open(objectId);
            loader.copyTo(out);
            return GitRepository.GitObject.builder()
                .content(out.toString(StandardCharsets.UTF_8))
                .path(treeWalk.getPathString())
                .objectId(objectId)
                .build();
        }
    }
This is {@link DefaultGitRepository}.

@author Misagh Moayyed
@since 6.1.0
support/cas-server-support-git-core/src/main/java/org/apereo/cas/git/DefaultGitRepository.java