public @Nullable Repository getRepositoryForRoot(@Nullable VirtualFile root) {
    return getRepositoryForRoot(root, true);
  }
public @Nullable Repository getRepositoryForRoot(@Nullable VirtualFile root)