public static void writePatches(@NotNull Project project,
                                  @NotNull Path file,
                                  @Nullable Path basePath,
                                  @NotNull List<? extends FilePatch> patches,
                                  @Nullable String commitMessage,
                                  @Nullable CommitContext commitContext,
                                  @NotNull Charset charset) throws IOException {
    Files.createDirectories(file.getParent());
    try (Writer writer = new OutputStreamWriter(Files.newOutputStream(file), charset)) {
      write(project, writer, basePath, patches, commitMessage, commitContext);
    }
  }
public static void writePatches(@NotNull Project project,
                                  @NotNull Path file,
                                  @Nullable Path basePath,
                                  @NotNull List<? extends FilePatch> patches,
                                  @Nullable String commitMessage,
                                  @Nullable CommitContext commitContext,
                                  @NotNull Charset charset)