Skip to content

Allow ResourceCommandResolver.getRightResource() to return undefined - #113364

Merged
Eric Amodio (eamodio) merged 9 commits into
microsoft:masterfrom
infinnie:patch-1
Jan 5, 2021
Merged

Eric Amodio (eamodio) merged 9 commits into
microsoft:masterfrom
infinnie:patch-1

Conversation

@infinnie

Copy link
Copy Markdown
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 joan xie (infinnie) changed the title Update repository.ts Allow ResourceCommandResolver.getRightResource() to return undefined Dec 24, 2020
Comment thread extensions/git/src/repository.ts Outdated

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

Copy link
Copy Markdown
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
Copy Markdown
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 Eric Amodio (eamodio) added this to the January 2021 milestone Jan 5, 2021
@eamodio Eric Amodio (eamodio) added the git GIT issues label Jan 5, 2021
@eamodio
Eric Amodio (eamodio) merged commit 1bb2ae0 into microsoft:master Jan 5, 2021
@eamodio

Copy link
Copy Markdown
Contributor

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