code: @SneakyThrows
      public Collection<GitObject> getObjectsInRepository(final TreeFilter filter) {
          val repository = this.gitInstance.getRepository();
          val head = repository.resolve(Constants.HEAD);
  
          try (val walk = new RevWalk(repository)) {
              val commit = walk.parseCommit(head);
              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;
              }
          }
      }
docs: Gets objects in repository.
  
  @param filter the filter
  @return the objects in repository