Remove extraneous entries in Source Control view for nested Git repos #7629
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR brings @theia/git behavior into line with the vs-code Git built-in. If a Git repository has a nested Git repository then @theia/git returns a single change resource for that repository. This results in an entry in the Source Control view that does not really make sense. Such entries do not appear when using the Git built-in, and of course would not appear in vs-code.
What it does
This PR filters out change resources that represent nested Git repositories. These are the only change resources returned by 'git status' that are folder URIs, so can be easily identified by a trailing '/'.
How to test
Create a Git repository with one or more nested Git repositories. On master branch, Open the Source Control view with @theia/git and with vs-code builtin. Note the extraneous entries only with @theia/git. Now test with this PR and the extraneous entries should be gone.
Review checklist
Reminder for reviewers