-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Fix git diff detection code #13851
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix git diff detection code #13851
Conversation
Kudos, SonarCloud Quality Gate passed!
|
Codecov Report
@@ Coverage Diff @@
## main #13851 +/- ##
==========================================
- Coverage 59.98% 59.95% -0.03%
==========================================
Files 685 685
Lines 38006 38006
Branches 5474 5474
==========================================
- Hits 22797 22788 -9
- Misses 14034 14040 +6
- Partials 1175 1178 +3
Continue to review full report at Codecov.
|
@@ -378,7 +378,7 @@ export class NativeEditorProviderOld extends NativeEditorProvider { | |||
(editorUri) => | |||
editorUri.document && | |||
editorUri.document.uri.scheme === 'git' && | |||
this.fs.arePathsSame(editorUri.document.uri, editor.document.uri) | |||
editorUri.document.uri.fsPath === editor.document.uri.fsPath |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
editorUri.document.uri.fsPath === editor.document.uri.fsPath | |
editorUri.document.uri.fsPath === editor.document.uri.fsPath |
Adding a comment would be useful & probably adding a test to ensure this works with different resource schemes (I'm assuming that's the case here).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I.e. we need to ensure we do not regress again, comment + test would be useful.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, sorry, merged this before this comment showed up! I'll put up a new PR @DonJayamanne
For https://github.com/microsoft/vscode-python/issues/13569
I regressed this as part of the filesystem refactor. In the following snippet,
editor.document.uri
has schemefile
, but the git diff editor has schemegit
, so doing a full URI object comparison viaarePathsSame
always returned false. I believe this is an exceptional case where we should be usingfsPath
instead of the URI object when comparing URIs.package-lock.json
has been regenerated by runningnpm install
(if dependencies have changed).