integrate libgit2 read tree function