Remove extraneous entries in Source Control view for nested Git repos#7629
Remove extraneous entries in Source Control view for nested Git repos#7629vince-fugnitto merged 1 commit intoeclipse-theia:masterfrom
Conversation
vince-fugnitto
left a comment
There was a problem hiding this comment.
@westbury is the pull-request still valid, if so can you please rebase and I can take a look for you 👍
…itories Signed-off-by: Nigel Westbury <nigelipse@miegel.org>
0f4d816 to
d386572
Compare
|
@vince-fugnitto Thanks for looking at this. Yes, it is still an issue that we would like to get fixed. I have rebased it. You will see that the extraneous entries all end with '/', and are the only entries that end with '/'. I was wondering if there was a better way of detecting these entries so I looked to see what vscode does. It seems they do exactly the same: |
vince-fugnitto
left a comment
There was a problem hiding this comment.
@westbury we might benefit from adding a unit-test under dugite.spec.ts for nested repos 👍
vince-fugnitto
left a comment
There was a problem hiding this comment.
I confirmed the bug on master and how this pull-request resolves similarly to vscode 👍
My only comment was adding a unit-test for it but I'll leave that up to your discretion.
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