From f4ca89503ef2bae923f8fbff6b43b402e8d11f43 Mon Sep 17 00:00:00 2001 From: Logan Ramos Date: Thu, 16 Jun 2022 12:38:08 -0400 Subject: [PATCH] Fix #151817 (#152356) --- .../workbench/contrib/files/browser/views/explorerViewer.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/vs/workbench/contrib/files/browser/views/explorerViewer.ts b/src/vs/workbench/contrib/files/browser/views/explorerViewer.ts index 3fd683669db..4064696d2bd 100644 --- a/src/vs/workbench/contrib/files/browser/views/explorerViewer.ts +++ b/src/vs/workbench/contrib/files/browser/views/explorerViewer.ts @@ -762,8 +762,9 @@ export class FilesFilter implements ITreeFilter { // Add newly visited .gitignore files to the ignore tree if (stat.name === '.gitignore') { this.processIgnoreFile(stat.root.resource.toString(), stat.resource, false); - // Never hide .gitignore files - return true; + // Never hide .gitignore files if explorer.excludeGitIgnore setting is enabled + // We can tell it's enabled if there is an ignore tree for the workspace root + return !!this.ignoreTreesPerRoot.get(stat.root.resource.toString()); } return this.isVisible(stat, parentVisibility);