reimplement Cache._init_trees using libgit2