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

git: fix discard changes when deleting #11532

Merged
merged 1 commit into from
Aug 8, 2022
Merged

Conversation

vince-fugnitto
Copy link
Member

What it does

Fixes: #11531.

The pull-request fixes an issue where we are unable to discard changes for files which are newly created.
The issue was that we were not passing an array of URIs which the handler expected:

registry.registerCommand(WorkspaceCommands.FILE_DELETE, this.newMultiUriAwareCommandHandler(this.deleteHandler));

protected newMultiUriAwareCommandHandler(handler: UriCommandHandler<URI[]>): UriAwareCommandHandler<URI[]> {
return UriAwareCommandHandler.MultiSelect(this.selectionService, handler);
}

How to test

  1. start the application with a workspace under version control (ex: theia)
  2. create a new file (ex: touch a.txt)
  3. open the scm-view and confirming discarding the file using the discard changes toolbar item works

Review checklist

Reminder for reviewers

Signed-off-by: vince-fugnitto vincent.fugnitto@ericsson.com

The commit fixes the call to `FILE_DELETE` which did not pass an array of URIs which the
`workspace-delete-handler` expected. This caused a bug where newly created files could not be
deleted.

Signed-off-by: vince-fugnitto <vincent.fugnitto@ericsson.com>
@vince-fugnitto vince-fugnitto added git issues related to git scm issues related to the source control manager labels Aug 4, 2022
Copy link
Member

@paul-marechal paul-marechal left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice catch, LGTM.

@vince-fugnitto vince-fugnitto merged commit b8df9e8 into master Aug 8, 2022
@vince-fugnitto vince-fugnitto deleted the vf/git-delete branch August 8, 2022 12:37
@github-actions github-actions bot added this to the 1.29.0 milestone Aug 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
git issues related to git scm issues related to the source control manager
Projects
None yet
Development

Successfully merging this pull request may close these issues.

scm: unable to discard changes for a newly created file
2 participants