jreybert / vimagit

Ease your git workflow within Vim
1.31k stars 49 forks source link

Discarding untracked file results in an error #165

Closed sudoremo closed 6 years ago

sudoremo commented 6 years ago

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

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

jreybert commented 6 years ago

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...