private void removeUnwantedRecords(@NotNull Collection<GitFileStatus> rootRecords,
                                     @NotNull RootDirtySet dirtyPaths) {
    ProjectLevelVcsManager vcsManager = ProjectLevelVcsManager.getInstance(myProject);
    VirtualFile repoRoot = myRepository.getRoot();

    int removedFiles = 0;
    int maxFilesToReport = 10;

    Iterator<GitFileStatus> it = rootRecords.iterator();
    while (it.hasNext()) {
      GitFileStatus record = it.next();

      boolean isUnderDirtyScope = isUnder(record, dirtyPaths);
      if (!isUnderDirtyScope) {
        it.remove();
        continue;
      }

      VirtualFile recordRoot = vcsManager.getVcsRootFor(record.getPath());
      boolean isUnderOurRoot = repoRoot.equals(recordRoot) || isSubmoduleStatus(record, recordRoot);
      if (isUnderOurRoot) continue; // keep the record

      it.remove();
      removedFiles++;
      if (removedFiles < maxFilesToReport || LOG.isDebugEnabled()) {
        LOG.warn(String.format("Ignoring change under another root: %s; root: %s; mapped root: %s",
                               record, repoRoot.getPresentableUrl(),
                               recordRoot != null ? recordRoot.getPresentableUrl() : "null"));
      }
    }
    if (removedFiles >= maxFilesToReport) {
      LOG.warn(String.format("Ignoring changed files under another root: %s files total", removedFiles));
    }
  }
private void removeUnwantedRecords(@NotNull Collection<GitFileStatus> rootRecords,
                                     @NotNull RootDirtySet dirtyPaths)