private static @NotNull Collection<Change> getDiff(@NotNull Project project,
                                                     @NotNull VirtualFile root,
                                                     @Nullable @NonNls String oldRevision,
                                                     @Nullable @NonNls String newRevision,
                                                     @Nullable Collection<? extends FilePath> dirtyPaths,
                                                     boolean detectRenames,
                                                     boolean threeDots) throws VcsException {
    LOG.assertTrue(oldRevision != null || newRevision != null, "Both old and new revisions can't be null");
    String range;
    GitRevisionNumber newRev;
    GitRevisionNumber oldRev;
    String dots;
    if (threeDots) {
      dots = "...";
    }
    else {
      dots = "..";
    }
    if (newRevision == null) { // current revision at the right
      range = oldRevision + dots;
      oldRev = resolveReference(project, root, oldRevision);
      newRev = null;
    }
    else if (oldRevision == null) { // current revision at the left
      range = dots + newRevision;
      oldRev = null;
      newRev = resolveReference(project, root, newRevision);
    }
    else {
      range = oldRevision + dots + newRevision;
      oldRev = resolveReference(project, root, oldRevision);
      newRev = resolveReference(project, root, newRevision);
    }
    String output = getDiffOutput(project, root, range, dirtyPaths, false, detectRenames);

    Collection<Change> changes = new ArrayList<>();
    parseChanges(project, root, newRev, oldRev, output, changes);
    return changes;
  }
private static @NotNull Collection<Change> getDiff(@NotNull Project project,
                                                     @NotNull VirtualFile root,
                                                     @Nullable @NonNls String oldRevision,
                                                     @Nullable @NonNls String newRevision,
                                                     @Nullable Collection<? extends FilePath> dirtyPaths,
                                                     boolean detectRenames,
                                                     boolean threeDots)