@ 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 ; } } }
Gets objects in repository .