private static List<TextFilePatch> loadPatches(@NotNull Project project,
                                                 @NotNull Path patchPath,
                                                 @Nullable CommitContext commitContext,
                                                 boolean loadContent) throws IOException, PatchSyntaxException {
    char[] text;
    try (Reader reader = new InputStreamReader(Files.newInputStream(patchPath), StandardCharsets.UTF_8)) {
      text = FileUtilRt.loadText(reader, (int)Files.size(patchPath));
    }
    PatchReader reader = new PatchReader(new CharArrayCharSequence(text), loadContent);
    List<TextFilePatch> textFilePatches = reader.readTextPatches();
    ApplyPatchDefaultExecutor.applyAdditionalInfoBefore(project, reader.getAdditionalInfo(null), commitContext);
    return textFilePatches;
  }
private static List<TextFilePatch> loadPatches(@NotNull Project project,
                                                 @NotNull Path patchPath,
                                                 @Nullable CommitContext commitContext,
                                                 boolean loadContent)