public static MergeData loadMergeData(@NotNull Project project,
                                        @NotNull VirtualFile root,
                                        @NotNull FilePath path,
                                        boolean isReversed) throws VcsException {
    byte[] originalContent = loadRevisionCatchingErrors(project, root, path, ORIGINAL_REVISION_NUM);
    byte[] yoursContent = loadRevisionCatchingErrors(project, root, path, YOURS_REVISION_NUM);
    byte[] theirsContent = loadRevisionCatchingErrors(project, root, path, THEIRS_REVISION_NUM);

    ConflictType conflictType = getConflictType(isReversed, originalContent != null, yoursContent != null, theirsContent != null);

    // TODO: can be done once for a root
    GitRevisionNumber yoursRevision = resolveHead(project, root);
    GitRevisionNumber theirsRevision = resolveMergeHead(project, root);
    GitRevisionNumber originalRevision = findOriginalRevisionNumber(project, root, yoursRevision, theirsRevision);


    Trinity<String, String, String> blobs = getAffectedBlobs(project, root, path);

    FilePath originalPath = getBlobPathInRevision(project, root, path, blobs.getFirst(), originalRevision);
    FilePath yoursPath = getBlobPathInRevision(project, root, path, blobs.getSecond(), yoursRevision);
    FilePath theirsPath = getBlobPathInRevision(project, root, path, blobs.getThird(), theirsRevision);

    if (originalContent == null) {
      // Unable to load original revision, read file content from disk (should have git-generated '>>>>>' marks)
      // This could happen in case of 'Added-Added' conflicts.
      originalContent = loadLocalFileContent(path);
    }
    else if (originalRevision != null && hasMergeConflictMarkers(originalContent)) {
      // If the 'recursive' or 'ort' merge strategies are used, BASE content might be a result of an incomplete automatic merge.
      // Such content causes poor results for an automatic merge by IDE.
      // Try to replace it with a better base version.
      try {
        originalContent = GitFileUtils.getFileContent(project, root, originalRevision.asString(), VcsFileUtil.relativePath(root, path));
      }
      catch (VcsException e) {
        LOG.info("Couldn't load a better base revision for " + path + " from " + originalRevision.asString() + ": " + e.getMessage());
      }
    }

    MergeData mergeData = new MergeData();

    mergeData.ORIGINAL = notNullize(originalContent);
    mergeData.CURRENT = notNullize(!isReversed ? yoursContent : theirsContent);
    mergeData.LAST = notNullize(isReversed ? yoursContent : theirsContent);

    mergeData.ORIGINAL_REVISION_NUMBER = originalRevision;
    mergeData.CURRENT_REVISION_NUMBER = !isReversed ? yoursRevision : theirsRevision;
    mergeData.LAST_REVISION_NUMBER = isReversed ? yoursRevision : theirsRevision;

    mergeData.ORIGINAL_FILE_PATH = originalPath;
    mergeData.CURRENT_FILE_PATH = !isReversed ? yoursPath : theirsPath;
    mergeData.LAST_FILE_PATH = isReversed ? yoursPath : theirsPath;

    mergeData.CONFLICT_TYPE = conflictType;

    return mergeData;
  }
public static MergeData loadMergeData(@NotNull Project project,
                                        @NotNull VirtualFile root,
                                        @NotNull FilePath path,
                                        boolean isReversed)