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

Discarding untracked file results in an error #165

Closed
sudoremo opened this issue Apr 25, 2018 · 1 comment
Closed

Discarding untracked file results in an error #165

sudoremo opened this issue Apr 25, 2018 · 1 comment
Labels
Milestone

Comments

@sudoremo
Copy link

Short description of the problem

Discarding an untracked file results in an error, even though g:magit_discard_untracked_do_delete is set to 1.

Thanks a bunch for looking at this and keep up your amazing work 👍

Steps to reproduce

  • Add let g:magit_discard_untracked_do_delete=1 to your .vimrc
  • touch untracked.txt
  • :Magit
  • Go to line of untracked.txt
  • DDD

This results in the following error:

Git error: error: pathspec 'bla.txt' did not match any file(s) known to git.^@
Git cmd: git checkout -- "bla.txt"
Error detected while processing function <SNR>144_nmapping_wrapper[2]..magit#stage_hunk[32]..magit#stage_block[32]..magit#git#git_checkout:
line    8:
E605: Exception not caught: checkout error
Error detected while processing function <SNR>144_nmapping_wrapper[2]..magit#stage_hunk[32]..magit#stage_block:
line   32:
E171: Missing :endif
Error detected while processing function <SNR>144_nmapping_wrapper:
line    2:
E171: Missing :endif

Environment

  • NVIM v0.2.2
  • git version 2.14.2
  • vimagit 85c25ffc60c8d144c7867c2e4d9f09cebb510cc0
  • macOS 10.11.6
  • terminal nvim (iTerm2)
@jreybert
Copy link
Owner

jreybert commented Oct 6, 2018

The error appears only if the file you discard is empty. Thanks for the report, it will be an easy one.

Sorry for the delay, I just start to unstack all the tickets of the year...

@jreybert jreybert added the bug label Oct 6, 2018
@jreybert jreybert added this to the Release 1.7.3 milestone Oct 12, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants