code: protected void processReferencesAndOutput(List<Ref> refList) {
                  List<String> refNames = new ArrayList<String>(refList.size());
  
                  for (Ref ref : refList) {
                          refNames.add(GitTaskUtils.sanitizeRefName(ref.getName()));
                  }
  
                  if (!namesToCheck.isEmpty()) {
                          if (!refNames.containsAll(namesToCheck)) {
                                  List<String> namesCopy = new ArrayList<String>(namesToCheck);
                                  namesCopy.removeAll(refNames);
  
                                  throw new GitBuildException(String.format(MISSING_REFS_TEMPLATE, namesCopy.toString()));
                          }
                  }
  
                  if (!GitTaskUtils.isNullOrBlankString(outputFilename)) {
                          FileUtils fileUtils = FileUtils.getFileUtils();
  
                          Echo echo = new Echo();
                          echo.setProject(getProject());
                          echo.setFile(fileUtils.resolveFile(getProject().getBaseDir(), outputFilename));
  
                          for (int i = 0; i < refNames.size(); i++) {
                                  String refName = refNames.get(i);
                                  echo.addText(String.format(REF_NAME_TEMPLATE, refName));
                          }
  
                          echo.perform();
                  }
          }
docs: Processes a list of references, check references names and output to a file if requested.
  
  @param refList The list of references to process