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

Fails to discard unstaged changes - cannot read property 'filename' of undefined #823

Closed
lresende opened this issue Nov 12, 2020 · 2 comments · Fixed by #824
Closed

Fails to discard unstaged changes - cannot read property 'filename' of undefined #823

lresende opened this issue Nov 12, 2020 · 2 comments · Fixed by #824
Labels

Comments

@lresende
Copy link
Member

Description

git-fails-to-discard-changes

This is using 0.23.0 but I believe I saw similar behavior on 0.22.x as well.

@lresende lresende added the bug label Nov 12, 2020
@ianhi
Copy link
Collaborator

ianhi commented Nov 12, 2020

on master I get this error: (edit: in retrospect the difference error messages is probably a firefox vs chrome difference)
image

I think two things are happening:

  1. options is being used outside of the check for if it is undefined here:
    this._revertFile(options.filename);
  2. discard all changes doesn't use the options to specify the files that are being discarded. instead it just run git checkout. This will revert the changes but if there are open editors then they won't be updated to reflect the state on disk. (I think this is also a bug)

@ianhi
Copy link
Collaborator

ianhi commented Nov 12, 2020

Changing the revertFile lines to:

        } else if (body.filename) {
          this._revertFile(body.filename);
        }

fixes the error, but there will still be the issue that open editors aren't updated when doing revert all changes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants