diff --git a/platform/lvcs-impl/src/com/intellij/history/integration/LocalHistoryEventDispatcher.kt b/platform/lvcs-impl/src/com/intellij/history/integration/LocalHistoryEventDispatcher.kt index a2f7a42eb38d..d72ad5d0742f 100644 --- a/platform/lvcs-impl/src/com/intellij/history/integration/LocalHistoryEventDispatcher.kt +++ b/platform/lvcs-impl/src/com/intellij/history/integration/LocalHistoryEventDispatcher.kt @@ -67,6 +67,14 @@ internal class LocalHistoryEventDispatcher(private val facade: LocalHistoryFacad true }, VirtualFileFilter { file -> isVersioned(file) }) } + + val inContent = IdeaGateway.getVersionedFilterData().myProjectFileIndices.any { it.isInContent(dir) } + + if (!inContent && isVersioned(dir)) { + // Non-recursively register this file or directory if it's outside project roots but is versioned. + // (recursive iteration would load files into VFS, we don't want it) + facade.created(gateway.getPathOrUrl(dir), dir.isDirectory) + } } private fun beforeContentsChange(e: VFileContentChangeEvent) {