private static Map<GitRepository, GitBranchPair> configureTarget(List<? extends GitRepository> repositories, String branchName) {

        Map<GitRepository, GitBranchPair> map = new LinkedHashMap<>();

        for (GitRepository repo : repositories) {
          GitLocalBranch currentBranch = repo.getCurrentBranch();
          GitRemoteBranch remoteBranch = repo.getBranches().findRemoteBranch(branchName);
          if (currentBranch != null && remoteBranch != null) {
            map.put(repo, new GitBranchPair(currentBranch, remoteBranch));
          }
        }

        return map;
      }
private static Map<GitRepository, GitBranchPair> configureTarget(List<? extends GitRepository> repositories, String branchName)