mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
vcs: filter potentially ignored files in externally added files (IDEA-211694)
GitOrigin-RevId: 631e2ba7a2b5cb23f39879faa5bdb6bd473df8d8
This commit is contained in:
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() {}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user