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 <[email protected]>
  • Loading branch information
westbury committed Apr 20, 2020
1 parent 983644d commit 0f4d816
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 @@ -871,7 +871,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 0f4d816

Please sign in to comment.