vcs: filter potentially ignored files in externally added files (IDEA-211694)

GitOrigin-RevId: 631e2ba7a2b5cb23f39879faa5bdb6bd473df8d8
This commit is contained in:
Dmitry Zhuravlev
2019-04-28 19:21:59 +03:00
committed by intellij-monorepo-bot
parent ae31c18f42
commit 4b3f93b9bc
@@ -9,6 +9,7 @@ import com.intellij.openapi.project.Project
import com.intellij.openapi.util.registry.Registry
import com.intellij.openapi.vcs.changes.ChangeListListener
import com.intellij.openapi.vcs.changes.ChangeListManagerImpl
import com.intellij.openapi.vcs.changes.VcsIgnoreManager
import com.intellij.openapi.vfs.VirtualFile
import com.intellij.openapi.vfs.newvfs.events.VFileCreateEvent
import com.intellij.openapi.vfs.newvfs.events.VFileEvent
@@ -41,6 +42,8 @@ class ExternallyAddedFilesProcessorImpl(project: Project,
private val vcsManager = ProjectLevelVcsManager.getInstance(project)
private val vcsIgnoreManager = VcsIgnoreManager.getInstance(project)
init {
runReadAction {
if (!project.isDisposed) {
@@ -126,7 +129,11 @@ class ExternallyAddedFilesProcessorImpl(project: Project,
}
override fun doFilterFiles(files: Collection<VirtualFile>): Collection<VirtualFile> =
changeListManager.unversionedFiles.filter { isUnder(files, it) }
changeListManager.unversionedFiles
.asSequence()
.filterNot(vcsIgnoreManager::isPotentiallyIgnoredFile)
.filter { isUnder(files, it) }
.toSet()
override fun rememberForAllProjects() {}