Skip to content

Commit

Permalink
Remove extraneous entries in Source Control view for nested Git repos…
Browse files Browse the repository at this point in the history
…itories

Signed-off-by: Nigel Westbury <nigelipse@miegel.org>
  • Loading branch information
westbury authored and vince-fugnitto committed Feb 25, 2021
1 parent 1ff2d0c commit 5bb23f4
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion packages/git/src/node/dugite-git.ts
Original file line number Diff line number Diff line change
Expand Up @@ -877,7 +877,14 @@ export class DugiteGit implements Git {
}

private async mapFileChanges(toMap: DugiteStatus, repositoryPath: string): Promise<GitFileChange[]> {
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<GitFileChange> {
Expand Down

0 comments on commit 5bb23f4

Please sign in to comment.