private @NotNull Map<GitRepository, GitPushRepoResult> push(@NotNull List<? extends GitRepository> repositories) {
    Map<GitRepository, GitPushRepoResult> results = new LinkedHashMap<>();
    for (GitRepository repository : repositories) {
      PushSpec<GitPushSource, GitPushTarget> spec = myPushSpecs.get(repository);
      ResultWithOutput resultWithOutput = null;
      GitPushRepoResult repoResult = null;

      StructuredIdeActivity pushActivity = GitOperationsCollector.startLogPush(repository.getProject());
      GitPushTargetType targetType = getPushTargetType(repository, spec);
      try {
        resultWithOutput = doPush(repository, spec);
        LOG.debug("Pushed to " + DvcsUtil.getShortRepositoryName(repository) + ": " + resultWithOutput);

        GitPushSource pushSource = spec.getSource();
        GitPushTarget target = spec.getTarget();
        if (resultWithOutput.isError()) {
          repoResult = GitPushRepoResult.error(pushSource, target.getBranch(), resultWithOutput.getErrorAsString());
        }
        else {
          List<GitPushNativeResult> nativeResults = resultWithOutput.parsedResults;
          final GitPushNativeResult sourceResult = getPushedBranchOrCommit(nativeResults);
          if (sourceResult == null) {
            LOG.error("No result for branch or commit among: [" + nativeResults + "]\n" +
                      "Full result: " + resultWithOutput);
            continue;
          }
          List<GitPushNativeResult> tagResults = filter(nativeResults, result ->
            !result.equals(sourceResult) && (result.getType() == NEW_REF || result.getType() == FORCED_UPDATE));
          int commits = collectNumberOfPushedCommits(repository.getRoot(), sourceResult);
          repoResult = GitPushRepoResult.convertFromNative(sourceResult, tagResults, commits, pushSource, target.getBranch());
        }
      }
      finally {
        GitOperationsCollector.endLogPush(pushActivity, resultWithOutput != null ? resultWithOutput.resultOutput : null, repoResult, targetType);
      }

      LOG.debug("Converted result: " + repoResult);
      results.put(repository, repoResult);
    }

    // fill other not-processed repositories as not-pushed
    for (GitRepository repository : repositories) {
      if (!results.containsKey(repository)) {
        PushSpec<GitPushSource, GitPushTarget> spec = myPushSpecs.get(repository);
        results.put(repository, GitPushRepoResult.notPushed(spec.getSource(), spec.getTarget().getBranch()));
      }
    }
    return results;
  }
private @NotNull Map<GitRepository, GitPushRepoResult> push(@NotNull List<? extends GitRepository> repositories)