@ SneakyThrows public GitObject readObject ( final TreeWalk treeWalk ) { val objectId = treeWalk . getObjectId ( 0 ) ; val repository = this . gitInstance . getRepository ( ) ; val loader = repository . open ( objectId ) ; val out = new ByteArrayOutputStream ( ) ; loader . copyTo ( out ) ; return GitObject . builder ( ) . content ( out . toString ( StandardCharsets . UTF_8 ) ) . treeWalk ( treeWalk ) . objectId ( objectId ) . build ( ) ; }
Read object .