From 0f4d81685fdb6a471fd7d260270821984b788287 Mon Sep 17 00:00:00 2001 From: Nigel Westbury Date: Fri, 17 Apr 2020 10:00:18 +0100 Subject: [PATCH] Remove extraneous entries in Source Control view for nested Git repositories Signed-off-by: Nigel Westbury --- packages/git/src/node/dugite-git.ts | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/packages/git/src/node/dugite-git.ts b/packages/git/src/node/dugite-git.ts index e4e412547404b..7c127a1279328 100644 --- a/packages/git/src/node/dugite-git.ts +++ b/packages/git/src/node/dugite-git.ts @@ -871,7 +871,14 @@ export class DugiteGit implements Git { } private async mapFileChanges(toMap: DugiteStatus, repositoryPath: string): Promise { - return Promise.all(toMap.files.map(file => this.mapFileChange(file, repositoryPath))); + return Promise.all(toMap.files + .filter(file => !this.isNestedGitRepository(file)) + .map(file => this.mapFileChange(file, repositoryPath)) + ); + } + + private isNestedGitRepository(fileChange: DugiteFileChange): boolean { + return fileChange.path.endsWith('/'); } private async mapFileChange(toMap: DugiteFileChange, repositoryPath: string): Promise {