void (@NotNull VirtualFile vcsDir, @NotNull Collection<String> subDirs) { vcsDir.getChildren(); for (String subdir : subDirs) { VirtualFile dir = vcsDir.findFileByRelativePath(subdir); // process recursively, because we need to visit all branches under refs/heads and refs/remotes ensureAllChildrenInVfs(dir); } }