Set<VirtualFile> (@NotNull Project project, @NotNull ReverseRequest reverseOrDetect) { if (Registry.is("git.do.not.swap.merge.conflict.sides")) return Collections.emptySet(); Set<VirtualFile> reverseMap = new HashSet<>(); for (GitRepository repository : GitUtil.getRepositoryManager(project).getRepositories()) { boolean reverse; if (reverseOrDetect == ReverseRequest.DETECT) { reverse = isReverseRoot(repository); } else { reverse = reverseOrDetect == ReverseRequest.REVERSE; } if (reverse) { reverseMap.add(repository.getRoot()); } } return reverseMap; }