public static void writeAsPatchToClipboard(@NotNull Project project,
                                             @NotNull List<? extends FilePatch> patches,
                                             @Nullable String commitMessage,
                                             @NotNull Path basePath,
                                             @Nullable CommitContext commitContext) throws IOException {
    StringWriter writer = new StringWriter();
    write(project, writer, basePath, patches, commitMessage, commitContext);
    CopyPasteManager.getInstance().setContents(new StringSelection(writer.toString()));
  }
public static void writeAsPatchToClipboard(@NotNull Project project,
                                             @NotNull List<? extends FilePatch> patches,
                                             @Nullable String commitMessage,
                                             @NotNull Path basePath,
                                             @Nullable CommitContext commitContext)