public static void writeCommitMessageHeader(@Nullable Project project,
                                              @NotNull Writer writer,
                                              @NotNull String lineSeparator,
                                              @Nullable String commitMessage) throws IOException {
    if (StringUtil.isEmpty(commitMessage)) return;
    boolean forceUnixSeparators = shouldForceUnixLineSeparator(project);
    String headerLineSeparator = forceUnixSeparators ? LineSeparator.LF.getSeparatorString()
                                                     : lineSeparator;
    writer.append(SUBJECT_HEADER);
    writer.append(StringUtil.convertLineSeparators(commitMessage.trim(), headerLineSeparator));
    writer.append(headerLineSeparator);
    writer.append(HEADER_END_MARKER);
    writer.append(headerLineSeparator);
  }
public static void writeCommitMessageHeader(@Nullable Project project,
                                              @NotNull Writer writer,
                                              @NotNull String lineSeparator,
                                              @Nullable String commitMessage)