@Override
    public Collection<GitObject> getObjectsInRepository(final TreeFilter filter) throws Exception {
        val repository = gitInstance.getRepository();
        val head = repository.resolve(Constants.HEAD);

        LOGGER.debug("Head object id is [{}]", head.toObjectId().toString());
        try (val walk = new RevWalk(repository)) {
            val commit = walk.parseCommit(head);
            LOGGER.debug("Head commit id is [{}]", commit.getId());
            val tree = commit.getTree();
            try (val treeWalk = new TreeWalk(repository)) {
                treeWalk.addTree(tree);
                treeWalk.setRecursive(true);
                treeWalk.setFilter(filter);
                val list = new ArrayList<GitObject>();
                while (treeWalk.next()) {
                    val object = readObject(treeWalk);
                    list.add(object);
                }
                return list;
            }
        }
    }
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