private static @Nls @NotNull String getCurrentBranchPresentation(@NotNull Project project,
                                                                   @NotNull Collection<? extends GitRepository> repositories,
                                                                   boolean truncateBranchName) {
    Set<String> currentBranches = map2SetNotNull(repositories,
                                                 repo -> repo.isFresh() ? repo.getCurrentBranchName() :
                                                         notNull(repo.getCurrentBranchName(),
                                                                 getShortHash(Objects.requireNonNull(repo.getCurrentRevision()))));

    if (currentBranches.size() == 1) {
      String fullBranchName = currentBranches.iterator().next();
      return truncateBranchName
             ? getCurrentBranchTruncatedName(fullBranchName, project)
             : wrapWithQuotes(fullBranchName);
    }
    return GitBundle.message("branches.current.branch");
  }
private static @Nls @NotNull String getCurrentBranchPresentation(@NotNull Project project,
                                                                   @NotNull Collection<? extends GitRepository> repositories,
                                                                   boolean truncateBranchName)