@Override
  public @Nullable Collection<Change> filter(@Nullable Project project, @NotNull List<Change> changes) {
    try {
      if (project == null) return null;

      MultiMap<Pair<GitRevisionNumber, VirtualFile>, FilePath> revisionMap = MultiMap.createSet();
      for (Change change : changes) {
        if (!putRevision(project, revisionMap, change.getBeforeRevision())) return null;
        if (!putRevision(project, revisionMap, change.getAfterRevision())) return null;
      }

      ProgressManager.checkCanceled();
      Map<Pair<GitRevisionNumber, FilePath>, String> blobs = new HashMap<>();
      for (Pair<GitRevisionNumber, VirtualFile> key : revisionMap.keySet()) {
        GitRevisionNumber revision = key.getFirst();
        VirtualFile root = key.getSecond();
        Collection<FilePath> filePaths = revisionMap.get(key);

        GitRepository repository = GitUtil.getRepositoryForRoot(project, root);
        List<GitIndexUtil.StagedFileOrDirectory> treeEntries = GitIndexUtil.listTree(repository, filePaths, revision);
        if (treeEntries.size() != filePaths.size()) {
          throw new VcsException(GitBundle.message("unexpected.tree.entries.error", revision));
        }

        for (GitIndexUtil.StagedFileOrDirectory entry : treeEntries) {
          if (entry instanceof GitIndexUtil.StagedFile) {
            String hash = ((GitIndexUtil.StagedFile)entry).getBlobHash();
            blobs.put(Pair.create(revision, entry.getPath()), hash);
          }
          else {
            throw new VcsException(GitBundle.message("unexpected.tree.object.error", entry));
          }
        }
      }

      ProgressManager.checkCanceled();
      List<Change> filtered = new ArrayList<>();
      for (Change change : changes) {
        if (acceptChange(blobs, change)) {
          filtered.add(change);
        }
      }
      return filtered;
    }
    catch (VcsException e) {
      LOG.warn(e);
      return null;
    }
  }
@Override
  public @Nullable Collection<Change> filter(@Nullable Project project, @NotNull List<Change> changes)