private void applyRefreshResult(@NotNull RefreshResult result,
                                  @Nullable RecursiveFilePathSet dirtyScope,
                                  @NotNull Set<FilePath> oldIgnored) {
    if (dirtyScope != null) {
      myUntrackedFiles.removeIf(filePath -> dirtyScope.hasAncestor(filePath));
      myUntrackedFiles.addAll(result.untracked);

      myIgnoredFiles.clear();

      for (FilePath filePath : oldIgnored) {
        if (!dirtyScope.hasAncestor(filePath)) {
          myIgnoredFiles.add(filePath);
        }
      }
      for (FilePath filePath : result.ignored) {
        if (!myIgnoredFiles.hasAncestor(filePath)) { // prevent storing both parent and child directories
          myIgnoredFiles.add(filePath);
        }
      }
    }
    else {
      myUntrackedFiles.clear();
      myUntrackedFiles.addAll(result.untracked);
      myIgnoredFiles.clear();
      myIgnoredFiles.addAll(result.ignored);
    }
  }
private void applyRefreshResult(@NotNull RefreshResult result,
                                  @Nullable RecursiveFilePathSet dirtyScope,
                                  @NotNull Set<FilePath> oldIgnored)