Skip to content
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

Merged
merged 9 commits into from Jan 5, 2021

Conversation

infinnie
Copy link
Contributor

This PR fixes #112537 and related issues.

By allowing the ResourceCommandResolver.getRightResource() method to return undefined, the Should never happen error would not be thrown (#112713) in rename/delete conflicts, where only the leftUri property is accessed.

@infinnie infinnie changed the title Update repository.ts Allow ResourceCommandResolver.getRightResource() to return undefined Dec 24, 2020
@infinnie infinnie mentioned this pull request Dec 25, 2020
@@ -80,15 +80,15 @@ export class Resource implements SourceControlResourceState {
}

get rightUri(): Uri {
return this.resources[1];
return this.resources[1] as Uri;
Copy link
Contributor

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.

Copy link
Contributor

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.

@eamodio eamodio added this to the January 2021 milestone Jan 5, 2021
@eamodio eamodio added the git GIT issues label Jan 5, 2021
@eamodio eamodio merged commit 1bb2ae0 into microsoft:master Jan 5, 2021
@eamodio
Copy link
Contributor

eamodio commented Jan 5, 2021

I've merged this now -- thanks for the fix!!

@github-actions github-actions bot locked and limited conversation to collaborators Feb 19, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
git GIT issues
Projects
None yet
Development

Successfully merging this pull request may close these issues.

SCM panel doesn't show git conflicts list of files
3 participants