String (@NotNull Map<GitRepository, String> heads) { MultiMap<String, VirtualFile> grouped = groupByBranches(heads); if (grouped.size() == 1) { return grouped.keySet().iterator().next(); } return StringUtil.join(grouped.entrySet(), entry -> { String roots = StringUtil.join(entry.getValue(), file -> file.getName(), ", "); return GitBundle.message("branch.operation.in", entry.getKey(), roots); }, UIUtil.BR); }