void (final FilePath newcomer) { final VirtualFile vcsRoot = myVcsManager.getVcsRootFor(newcomer); if (vcsRoot == null) return; myAffectedVcsRoots.add(vcsRoot); RecursiveFilePathSet dirsByRoot = myDirtyDirectoriesRecursively.get(vcsRoot); if (dirsByRoot != null && dirsByRoot.hasAncestor(newcomer)) { return; } Set<FilePath> dirtyFiles = myDirtyFiles.get(vcsRoot); if (dirtyFiles == null) { dirtyFiles = newFilePathsSet(); myDirtyFiles.put(vcsRoot, dirtyFiles); } else { if (newcomer.isDirectory()) { for (Iterator<FilePath> iterator = dirtyFiles.iterator(); iterator.hasNext(); ) { final FilePath oldBoy = iterator.next(); if (!oldBoy.isDirectory() && (myHashingStrategy == null ? Objects.equals(oldBoy.getParentPath(), newcomer) : myHashingStrategy.equals(oldBoy.getParentPath(), newcomer))) { iterator.remove(); } } } else if (!dirtyFiles.isEmpty()) { FilePath parent = newcomer.getParentPath(); if (parent != null && dirtyFiles.contains(parent)) { return; } } } dirtyFiles.add(newcomer); }