VisiblePack (@NotNull VisiblePack visiblePack) { DataPackBase dataPack = visiblePack.getDataPack(); if (dataPack instanceof DataPack.ErrorDataPack) { return visiblePack; } if (visiblePack.getVisibleGraph().getVisibleCommitCount() == 0 || !(visiblePack.getVisibleGraph() instanceof VisibleGraphImpl)) { DataPackBase newDataPack = new DataPackBase(dataPack.getLogProviders(), RefsModel.createEmptyInstance(myStorage), false); if (visiblePack instanceof VisiblePack.ErrorVisiblePack) { return new VisiblePack.ErrorVisiblePack(newDataPack, visiblePack.getFilters(), ((VisiblePack.ErrorVisiblePack)visiblePack).getError()); } return new VisiblePack(newDataPack, EmptyVisibleGraph.getInstance(), true, visiblePack.getFilters()); } return build(dataPack, ((VisibleGraphImpl<Integer>)visiblePack.getVisibleGraph()), visiblePack.getFilters(), visiblePack.getAdditionalData()); }