private static void writeFileHeading(@NotNull final Writer writer,
                                       @Nullable Path basePath,
                                       @NotNull final FilePatch patch,
                                       @NotNull final String lineSeparator,
                                       @Nullable Map<String, CharSequence> additionalMap) throws IOException {
    writer.write(MessageFormat.format(INDEX_SIGNATURE, patch.getBeforeName(), lineSeparator));
    writeAdditionalInfo(writer, lineSeparator, additionalMap);
    writer.write(HEADER_SEPARATOR + lineSeparator);
    GitPatchWriter.writeGitHeader(writer, basePath, patch, lineSeparator);
    writeRevisionHeading(writer, "---", getRevisionHeadingPath(patch, true),
                         patch.getBeforeVersionId(), lineSeparator);
    writeRevisionHeading(writer, "+++", getRevisionHeadingPath(patch, false),
                         patch.getAfterVersionId(), lineSeparator);
  }
private static void writeFileHeading(@NotNull final Writer writer,
                                       @Nullable Path basePath,
                                       @NotNull final FilePatch patch,
                                       @NotNull final String lineSeparator,
                                       @Nullable Map<String, CharSequence> additionalMap)