-
Notifications
You must be signed in to change notification settings - Fork 30.8k
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
Allow ResourceCommandResolver.getRightResource() to return undefined #113364
Conversation
fix microsoft#112537 and related issues.
change command order
Add corresponding integration test
Update smoke.test.ts
extensions/git/src/repository.ts
Outdated
@@ -80,15 +80,15 @@ export class Resource implements SourceControlResourceState { | |||
} | |||
|
|||
get rightUri(): Uri { | |||
return this.resources[1]; | |||
return this.resources[1] as Uri; |
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 don't think this is a good idea -- this should either return Uri | undefined
or it should throw.
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 checked and adding undefined
doesn't (visibly) cause any issues.
I've merged this now -- thanks for the fix!! |
This PR fixes #112537 and related issues.
By allowing the
ResourceCommandResolver.getRightResource()
method to return undefined, theShould never happen
error would not be thrown (#112713) in rename/delete conflicts, where only theleftUri
property is accessed.